@@ -11,7 +11,7 @@ use rustc_hash::FxHashSet as HashSet;
1111use std:: env;
1212use std:: ffi:: { OsStr , OsString } ;
1313use std:: fs:: { self , DirEntry , File , Metadata } ;
14- use std:: io:: { BufRead , BufReader , stdout} ;
14+ use std:: io:: { BufRead , BufReader , Write , stdout} ;
1515#[ cfg( not( windows) ) ]
1616use std:: os:: unix:: fs:: MetadataExt ;
1717#[ cfg( windows) ]
@@ -20,6 +20,7 @@ use std::path::{Path, PathBuf};
2020use std:: str:: FromStr ;
2121use std:: sync:: mpsc;
2222use std:: thread;
23+ use std:: { env, io} ;
2324use thiserror:: Error ;
2425use uucore:: display:: { Quotable , print_verbatim} ;
2526use uucore:: error:: { FromIo , UError , UResult , USimpleError , set_exit_code} ;
@@ -888,7 +889,7 @@ impl StatPrinter {
888889 }
889890
890891 fn print_stat ( & self , stat : & Stat , size : u64 ) -> UResult < ( ) > {
891- print ! ( "{}\t " , self . convert_size( size) ) ;
892+ write ! ( io :: stdout ( ) , "{}\t " , self . convert_size( size) ) ? ;
892893
893894 if let Some ( md_time) = & self . time {
894895 if let Some ( time) = metadata_get_time ( & stat. metadata , * md_time) {
@@ -904,8 +905,8 @@ impl StatPrinter {
904905 }
905906 }
906907
907- print_verbatim ( & stat. path ) . unwrap ( ) ;
908- print ! ( "{}" , self . line_ending) ;
908+ print_verbatim ( & stat. path ) ? ;
909+ write ! ( io :: stdout ( ) , "{}" , self . line_ending) ? ;
909910
910911 Ok ( ( ) )
911912 }
0 commit comments