File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -272,3 +272,11 @@ impl<'a> CommandList<'a> {
272272 }
273273 }
274274}
275+
276+ pub fn inspect_stderr ( stderr : & [ u8 ] ) {
277+ let text = String :: from_utf8_lossy ( stderr) ;
278+ let text = text. trim ( ) ;
279+ if !text. is_empty ( ) {
280+ eprintln ! ( "STDERR:\n {}\n " , text) ;
281+ }
282+ }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ pub mod _utils;
44pub use _utils:: * ;
55
66use command_extra:: CommandExtra ;
7- use pipe_trait:: Pipe ;
87use std:: process:: Stdio ;
98
109/// There are branches of similar shapes in `/src/app.rs` that call
@@ -32,11 +31,7 @@ fn flag_combinations() {
3231 . with_stderr ( Stdio :: piped ( ) )
3332 . output ( )
3433 . expect ( "execute command" ) ;
35- let error = output. stderr . pipe_as_ref ( String :: from_utf8_lossy) ;
36- let error = error. trim ( ) ;
37- if !error. is_empty ( ) {
38- eprintln ! ( "STDERR:\n {}\n " , error) ;
39- }
34+ inspect_stderr ( & output. stderr ) ;
4035 let status = output. status ;
4136 assert ! ( status. success( ) , "status: {:?}" , status. code( ) )
4237 }
You can’t perform that action at this time.
0 commit comments