Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/uu/numfmt/src/format.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::io::{Write, stdout};

// This file is part of the uutils coreutils package.
//
// For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -479,7 +481,7 @@ pub fn format_and_print_delimited(input: &[u8], options: &NumfmtOptions) -> Resu
}

output.push(eol);
std::io::Write::write_all(&mut std::io::stdout(), &output).map_err(|e| e.to_string())?;
stdout().write_all(&output).map_err(|e| e.to_string())?;

Ok(())
}
Expand Down Expand Up @@ -523,7 +525,9 @@ pub fn format_and_print_whitespace(s: &str, options: &NumfmtOptions) -> Result<(

let eol = if options.zero_terminated { '\0' } else { '\n' };
output.push(eol);
print!("{output}");
stdout()
.write_all(output.as_bytes())
.map_err(|e| e.to_string())?;

Ok(())
}
Expand Down
Loading