Skip to content

Commit 5d08792

Browse files
Copilotsundy-li
andcommitted
Fix: use correct Write trait for Vec<u8> buffer
Move std::io::Write import inside the function to avoid trait conflicts Co-authored-by: sundy-li <[email protected]>
1 parent 603683d commit 5d08792

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/meta/kvapi/src/kvapi/key_builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ impl KeyBuilder {
4747
}
4848

4949
pub fn push_u64(mut self, n: u64) -> Self {
50-
use std::io::Write;
51-
5250
if !self.buf.is_empty() {
5351
// `/`
5452
self.buf.push(0x2f);
5553
}
5654

5755
// Write directly to buffer instead of allocating a string
56+
use std::io::Write;
5857
write!(self.buf, "{}", n).unwrap();
5958
self
6059
}

0 commit comments

Comments
 (0)