perf(allocator/bitset): avoid temp heap String allocation (#22403)

admittedly this is a bit unnecessary, but no harm in optimizing it.
This commit is contained in:
camc314 committed 2026-05-14 17:32:07 +00:00
1 parent 5478fb5aad
commit 73a9043bf4
1 file changed
+3 -3
+3 -3
View File
@@ -120,10 +120,10 @@ impl Display for BitSet<'_> {
}
let highest_byte = bytes.next().unwrap();
f.write_str(&format!("{highest_byte:08b}"))?;
write!(f, "{highest_byte:08b}")?;
for byte in bytes {
f.write_str(&format!("_{byte:08b}"))?;
write!(f, "_{byte:08b}")?;
}
// Print remaining `usize`s without skipping any bytes
@@ -135,7 +135,7 @@ impl Display for BitSet<'_> {
let bytes = bytes.iter();
for byte in bytes {
f.write_str(&format!("_{byte:08b}"))?;
write!(f, "_{byte:08b}")?;
}
}