We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcb890b commit eccd157Copy full SHA for eccd157
1 file changed
src/uu/split/src/number.rs
@@ -15,7 +15,7 @@
15
//! [radix]: https://en.wikipedia.org/wiki/Radix
16
//! [positional notation]: https://en.wikipedia.org/wiki/Positional_notation
17
use std::error::Error;
18
-use std::fmt::{self, Display, Formatter};
+use std::fmt::{self, Display, Formatter, Write};
19
use uucore::translate;
20
21
/// An overflow due to incrementing a number beyond its representable limit.
@@ -244,12 +244,10 @@ impl FixedWidthNumber {
244
245
impl Display for FixedWidthNumber {
246
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
247
- let digits: String = self
248
- .digits
249
- .iter()
250
- .map(|d| map_digit(self.radix, *d))
251
- .collect();
252
- write!(f, "{digits}")
+ for d in &self.digits {
+ f.write_char(map_digit(self.radix, *d))?;
+ }
+ Ok(())
253
}
254
255
0 commit comments