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 ba1afb0 commit e90d61fCopy full SHA for e90d61f
src/uu/du/src/du.rs
@@ -11,7 +11,7 @@ use rustc_hash::FxHashSet as HashSet;
11
use std::env;
12
use std::ffi::{OsStr, OsString};
13
use std::fs::{self, DirEntry, File, Metadata};
14
-use std::io::{BufRead, BufReader, stdout};
+use std::io::{BufRead, BufReader, Write, stdout};
15
#[cfg(not(windows))]
16
use std::os::unix::fs::MetadataExt;
17
#[cfg(windows)]
@@ -888,7 +888,7 @@ impl StatPrinter {
888
}
889
890
fn print_stat(&self, stat: &Stat, size: u64) -> UResult<()> {
891
- print!("{}\t", self.convert_size(size));
+ write!(stdout(), "{}\t", self.convert_size(size))?;
892
893
if let Some(md_time) = &self.time {
894
if let Some(time) = metadata_get_time(&stat.metadata, *md_time) {
@@ -904,8 +904,8 @@ impl StatPrinter {
904
905
906
907
- print_verbatim(&stat.path).unwrap();
908
- print!("{}", self.line_ending);
+ print_verbatim(&stat.path)?;
+ write!(stdout(), "{}", self.line_ending)?;
909
910
Ok(())
911
0 commit comments