File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -43,22 +43,20 @@ impl SubCommand {
43
43
let entry = entry?;
44
44
let file_type = entry. file_type ( ) ?;
45
45
let path = entry. path ( ) ;
46
- let name = match path. file_name ( )
46
+ let name = path. file_name ( )
47
47
. and_then ( |name| name. to_str ( ) )
48
48
. and_then ( |name| name. strip_prefix ( c2rust_name) )
49
49
. and_then ( |name| name. strip_prefix ( '-' ) )
50
50
. map ( |name| name. to_owned ( ) )
51
51
. map ( Cow :: from)
52
52
. filter ( |_| file_type. is_file ( ) || file_type. is_symlink ( ) )
53
- . filter ( |_| path. is_executable ( ) )
54
- {
55
- Some ( name) => name,
56
- None => continue ,
57
- } ;
58
- sub_commands. push ( Self {
59
- path : Some ( path) ,
60
- name,
61
- } ) ;
53
+ . filter ( |_| path. is_executable ( ) ) ;
54
+ if let Some ( name) = name {
55
+ sub_commands. push ( Self {
56
+ path : Some ( path) ,
57
+ name,
58
+ } ) ;
59
+ }
62
60
}
63
61
Ok ( sub_commands)
64
62
}
You can’t perform that action at this time.
0 commit comments