This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -311,8 +311,7 @@ fn run_rustfmt(
311
311
fmt_args : & [ String ] ,
312
312
verbosity : Verbosity ,
313
313
) -> Result < i32 , io:: Error > {
314
- let default_edition = String :: from ( "2015" ) ;
315
- let mut by_edition = targets
314
+ let by_edition = targets
316
315
. iter ( )
317
316
. inspect ( |t| {
318
317
if verbosity == Verbosity :: Verbose {
@@ -324,10 +323,8 @@ fn run_rustfmt(
324
323
h. entry ( t. 0 ) . or_insert_with ( Vec :: new) . push ( t. 1 ) ;
325
324
h
326
325
} ) ;
327
- if by_edition. is_empty ( ) {
328
- by_edition. insert ( & default_edition, Vec :: new ( ) ) ;
329
- }
330
326
327
+ let mut status = vec ! [ ] ;
331
328
for ( edition, files) in by_edition {
332
329
let stdout = if verbosity == Verbosity :: Quiet {
333
330
std:: process:: Stdio :: null ( )
@@ -357,13 +354,14 @@ fn run_rustfmt(
357
354
_ => e,
358
355
} ) ?;
359
356
360
- let status = command. wait ( ) ?;
361
- if !status. success ( ) {
362
- return Ok ( status. code ( ) . unwrap_or ( FAILURE ) ) ;
363
- }
357
+ status. push ( command. wait ( ) ?) ;
364
358
}
365
359
366
- Ok ( SUCCESS )
360
+ Ok ( status
361
+ . iter ( )
362
+ . filter_map ( |s| if s. success ( ) { None } else { s. code ( ) } )
363
+ . next ( )
364
+ . unwrap_or ( SUCCESS ) )
367
365
}
368
366
369
367
fn get_cargo_metadata ( manifest_path : Option < & Path > ) -> Result < cargo_metadata:: Metadata , io:: Error > {
You can’t perform that action at this time.
0 commit comments