File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ fn _mknod(file_name: &str, config: Config) -> i32 {
109
109
pub fn uumain ( args : impl uucore:: Args ) -> UResult < ( ) > {
110
110
let matches = uu_app ( ) . try_get_matches_from ( args) ?;
111
111
112
- let mode = get_mode ( & matches) . map_err ( |e| USimpleError :: new ( 1 , e) ) ?;
112
+ let mode = get_mode ( matches. get_one :: < String > ( "mode" ) ) . map_err ( |e| USimpleError :: new ( 1 , e) ) ?;
113
113
114
114
let file_name = matches
115
115
. get_one :: < String > ( "name" )
@@ -222,8 +222,8 @@ pub fn uu_app() -> Command {
222
222
) )
223
223
}
224
224
225
- fn get_mode ( matches : & ArgMatches ) -> Result < mode_t , String > {
226
- match matches . get_one :: < String > ( "mode" ) {
225
+ fn get_mode ( str_mode : Option < & String > ) -> Result < mode_t , String > {
226
+ match str_mode {
227
227
None => Ok ( MODE_RW_UGO ) ,
228
228
Some ( str_mode) => uucore:: mode:: parse_mode ( str_mode)
229
229
. map_err ( |e| format ! ( "invalid mode ({e})" ) )
You can’t perform that action at this time.
0 commit comments