File tree 3 files changed +6
-11
lines changed
3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -488,7 +488,7 @@ fn format(opt: Opt) -> Result<i32> {
488
488
if opt. verbose {
489
489
if let Some ( paths) = config_paths. as_ref ( ) {
490
490
println ! (
491
- "Using rustfmt config files {}" ,
491
+ "Using rustfmt config file(s) {}" ,
492
492
paths
493
493
. into_iter( )
494
494
. map( |p| p. display( ) . to_string( ) )
Original file line number Diff line number Diff line change @@ -273,14 +273,10 @@ impl Config {
273
273
274
274
// List of closest -> most distant rustfmt config from the current directory.
275
275
let config_paths: Option < Vec < _ > > = paths. into_iter ( ) . filter ( |p| p. is_some ( ) ) . collect ( ) ;
276
- let has_paths = config_paths. as_ref ( ) . and_then ( |paths| {
277
- if paths. is_empty ( ) {
278
- None
279
- } else {
280
- Some ( paths. len ( ) )
281
- }
282
- } ) ;
283
- if has_paths. is_some ( ) {
276
+ let has_paths = config_paths
277
+ . as_ref ( )
278
+ . map_or ( false , |paths| !paths. is_empty ( ) ) ;
279
+ if has_paths {
284
280
return Ok ( config_paths) ;
285
281
}
286
282
Original file line number Diff line number Diff line change @@ -292,8 +292,7 @@ impl IgnoreList {
292
292
p. strip_prefix ( new_rustfmt_toml_path. parent ( ) . unwrap ( ) )
293
293
. map ( PathBuf :: from)
294
294
} )
295
- . filter ( |p| p. is_ok ( ) )
296
- . map ( |p| p. unwrap ( ) )
295
+ . flatten ( )
297
296
. collect ( ) ;
298
297
299
298
let mut path_set = other. path_set ;
You can’t perform that action at this time.
0 commit comments