File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ struct PathWrapper {
335335}
336336
337337impl PathWrapper {
338- fn from_dir_entry ( path : PathBuf , file_name : OsString , e : DirEntry ) -> Self {
338+ fn from_dir_entry ( path : PathBuf , file_name : Option < OsString > , e : DirEntry ) -> Self {
339339 let is_directory = e
340340 . file_type ( )
341341 . ok ( )
@@ -353,7 +353,7 @@ impl PathWrapper {
353353 Self {
354354 path,
355355 is_directory,
356- file_name : Some ( file_name ) ,
356+ file_name,
357357 }
358358 }
359359 fn from_path ( path : PathBuf ) -> Self {
@@ -941,10 +941,10 @@ fn fill_todo(
941941 let ( path, file_name) = if curdir {
942942 let path = e. path ( ) ;
943943 let file_name = path. file_name ( ) . unwrap ( ) ;
944- ( PathBuf :: from ( file_name) , file_name. to_owned ( ) )
944+ ( PathBuf :: from ( file_name) , Some ( file_name. to_owned ( ) ) )
945945 } else {
946946 let path = e. path ( ) ;
947- let file_name = path. file_name ( ) . unwrap ( ) . to_owned ( ) ;
947+ let file_name = path. file_name ( ) . map ( ToOwned :: to_owned) ;
948948 ( path, file_name)
949949 } ;
950950 PathWrapper :: from_dir_entry ( path, file_name, e)
You can’t perform that action at this time.
0 commit comments