File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66use clap:: { Arg , ArgAction , Command } ;
77use std:: ffi:: OsString ;
8+ use std:: io:: { Write as _, stdout} ;
89#[ cfg( unix) ]
910use uucore:: display:: print_verbatim;
1011use uucore:: error:: { UResult , UUsageError } ;
@@ -122,20 +123,20 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
122123 {
123124 use std:: os:: unix:: ffi:: OsStrExt ;
124125 let result_os = std:: ffi:: OsStr :: from_bytes ( result) ;
125- print_verbatim ( result_os) . unwrap ( ) ;
126+ print_verbatim ( result_os) ? ;
126127 }
127128 #[ cfg( not( unix) ) ]
128129 {
129130 // On non-Unix, fall back to lossy conversion
130131 if let Ok ( s) = std:: str:: from_utf8 ( result) {
131- print ! ( "{s}" ) ;
132+ write ! ( stdout ( ) , "{s}" ) ? ;
132133 } else {
133134 // Fallback for non-UTF-8 paths on non-Unix systems
134- print ! ( "." ) ;
135+ write ! ( stdout , "." ) ? ;
135136 }
136137 }
137138
138- print ! ( "{line_ending}" ) ;
139+ write ! ( stdout ( ) , "{line_ending}" ) ? ;
139140 }
140141
141142 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments