@@ -106,6 +106,7 @@ macro_rules! create_config {
106
106
| "chain_width" => self . 0 . set_heuristics( ) ,
107
107
"license_template_path" => self . 0 . set_license_template( ) ,
108
108
"merge_imports" => self . 0 . set_merge_imports( ) ,
109
+ "match_arm_blocks" => self . 0 . set_match_arm_blocks( ) ,
109
110
& _ => ( ) ,
110
111
}
111
112
}
@@ -166,6 +167,7 @@ macro_rules! create_config {
166
167
self . set_license_template( ) ;
167
168
self . set_ignore( dir) ;
168
169
self . set_merge_imports( ) ;
170
+ self . set_match_arm_blocks( ) ;
169
171
self
170
172
}
171
173
@@ -249,14 +251,16 @@ macro_rules! create_config {
249
251
| "chain_width" => self . set_heuristics( ) ,
250
252
"license_template_path" => self . set_license_template( ) ,
251
253
"merge_imports" => self . set_merge_imports( ) ,
254
+ "match_arm_blocks" => self . set_match_arm_blocks( ) ,
252
255
& _ => ( ) ,
253
256
}
254
257
}
255
258
256
259
#[ allow( unreachable_pub) ]
257
260
pub fn is_hidden_option( name: & str ) -> bool {
258
- const HIDE_OPTIONS : [ & str ; 5 ] =
259
- [ "verbose" , "verbose_diff" , "file_lines" , "width_heuristics" , "merge_imports" ] ;
261
+ const HIDE_OPTIONS : [ & str ; 6 ] =
262
+ [ "verbose" , "verbose_diff" , "file_lines" , "width_heuristics" , "merge_imports" ,
263
+ "match_arm_blocks" ] ;
260
264
HIDE_OPTIONS . contains( & name)
261
265
}
262
266
@@ -421,6 +425,22 @@ macro_rules! create_config {
421
425
}
422
426
}
423
427
428
+ fn set_match_arm_blocks( & mut self ) {
429
+ if self . was_set( ) . match_arm_blocks( ) {
430
+ eprintln!(
431
+ "Warning: the `match_arm_blocks` option is deprecated. \
432
+ Use `match_arm_wrapping` instead"
433
+ ) ;
434
+ if !self . was_set( ) . match_arm_wrapping( ) {
435
+ self . match_arm_wrapping. 2 = if self . match_arm_blocks( ) {
436
+ MatchArmWrapping :: Default
437
+ } else {
438
+ MatchArmWrapping :: NoBlockFirstLine
439
+ } ;
440
+ }
441
+ }
442
+ }
443
+
424
444
#[ allow( unreachable_pub) ]
425
445
/// Returns `true` if the config key was explicitly set and is the default value.
426
446
pub fn is_default( & self , key: & str ) -> bool {
0 commit comments