File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -322,15 +322,18 @@ fn run_rustfmt(
322
322
fmt_args : & [ String ] ,
323
323
verbosity : Verbosity ,
324
324
) -> Result < i32 , io:: Error > {
325
- let by_edition: HashMap < _ , _ > = targets
325
+ let by_edition = targets
326
326
. iter ( )
327
327
. inspect ( |t| {
328
328
if verbosity == Verbosity :: Verbose {
329
329
println ! ( "[{} ({})] {:?}" , t. kind, t. edition, t. path)
330
330
}
331
331
} )
332
- . map ( |t| ( & t. edition , vec ! [ & t. path] ) )
333
- . collect ( ) ;
332
+ . map ( |t| ( & t. edition , & t. path ) )
333
+ . fold ( HashMap :: new ( ) , |mut h, t| {
334
+ h. entry ( t. 0 ) . or_insert_with ( Vec :: new) . push ( t. 1 ) ;
335
+ h
336
+ } ) ;
334
337
335
338
for ( edition, files) in by_edition {
336
339
let stdout = if verbosity == Verbosity :: Quiet {
@@ -341,6 +344,7 @@ fn run_rustfmt(
341
344
342
345
if verbosity == Verbosity :: Verbose {
343
346
print ! ( "rustfmt" ) ;
347
+ print ! ( " --edition {}" , edition) ;
344
348
fmt_args. iter ( ) . for_each ( |f| print ! ( " {}" , f) ) ;
345
349
files. iter ( ) . for_each ( |f| print ! ( " {}" , f. display( ) ) ) ;
346
350
println ! ( ) ;
You can’t perform that action at this time.
0 commit comments