@@ -142,10 +142,11 @@ fn format_crate(
142
142
strategy : & CargoFmtStrategy ,
143
143
rustfmt_args : Vec < String > ,
144
144
) -> Result < i32 , io:: Error > {
145
- let targets = if rustfmt_args
146
- . iter ( )
147
- . any ( |s| [ "--print-config" , "-h" , "--help" , "-V" , "--version" ] . contains ( & s. as_str ( ) ) )
148
- {
145
+ let targets = if rustfmt_args. iter ( ) . any ( |s| {
146
+ [ "--print-config" , "-h" , "--help" , "-V" , "--version" ] . contains ( & s. as_str ( ) )
147
+ || s. starts_with ( "--help=" )
148
+ || s. starts_with ( "--print-config=" )
149
+ } ) {
149
150
BTreeSet :: new ( )
150
151
} else {
151
152
get_targets ( strategy) ?
@@ -333,7 +334,7 @@ fn run_rustfmt(
333
334
fmt_args : & [ String ] ,
334
335
verbosity : Verbosity ,
335
336
) -> Result < i32 , io:: Error > {
336
- let by_edition = targets
337
+ let mut by_edition = targets
337
338
. iter ( )
338
339
. inspect ( |t| {
339
340
if verbosity == Verbosity :: Verbose {
@@ -345,6 +346,11 @@ fn run_rustfmt(
345
346
h
346
347
} ) ;
347
348
349
+ let s = "2018" . to_string ( ) ;
350
+ if by_edition. is_empty ( ) {
351
+ by_edition. insert ( & s, vec ! [ ] ) ;
352
+ }
353
+
348
354
let mut status = vec ! [ ] ;
349
355
for ( edition, files) in by_edition {
350
356
let stdout = if verbosity == Verbosity :: Quiet {
0 commit comments