File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ use std::collections::BTreeMap;
10
10
use std:: fmt;
11
11
use std:: io:: { BufRead , BufReader , ErrorKind } ;
12
12
use std:: path:: { Path , PathBuf } ;
13
- use std:: process:: Command ;
14
- use std:: str:: { from_utf8, FromStr } ;
13
+ use std:: str:: FromStr ;
15
14
use toml_edit:: easy as toml;
16
15
17
16
#[ derive( Clone , Copy , Debug , PartialEq ) ]
@@ -830,14 +829,12 @@ mod tests {
830
829
paths:: write ( & path_of_source_file, default_file_content) ?;
831
830
832
831
// Format the newly created source file
833
- match Command :: new ( "rustfmt" ) . arg ( & path_of_source_file) . output ( ) {
834
- Err ( e) => log:: warn!( "failed to call rustfmt: {}" , e) ,
835
- Ok ( output) => {
836
- if !output. status . success ( ) {
837
- log:: warn!( "rustfmt failed: {:?}" , from_utf8( & output. stdout) ) ;
838
- }
839
- }
840
- } ;
832
+ if let Err ( e) = cargo_util:: ProcessBuilder :: new ( "rustfmt" )
833
+ . arg ( & path_of_source_file)
834
+ . exec_with_output ( )
835
+ {
836
+ log:: warn!( "failed to call rustfmt: {:#}" , e) ;
837
+ }
841
838
}
842
839
}
843
840
You can’t perform that action at this time.
0 commit comments