File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,22 +43,20 @@ impl SubCommand {
4343 let entry = entry?;
4444 let file_type = entry. file_type ( ) ?;
4545 let path = entry. path ( ) ;
46- let name = match path. file_name ( )
46+ let name = path. file_name ( )
4747 . and_then ( |name| name. to_str ( ) )
4848 . and_then ( |name| name. strip_prefix ( c2rust_name) )
4949 . and_then ( |name| name. strip_prefix ( '-' ) )
5050 . map ( |name| name. to_owned ( ) )
5151 . map ( Cow :: from)
5252 . 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+ }
6260 }
6361 Ok ( sub_commands)
6462 }
You can’t perform that action at this time.
0 commit comments