File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ use super::{
66 size,
77 tree_builder:: { Info , TreeBuilder } ,
88} ;
9- use pipe_trait:: Pipe ;
109use std:: {
1110 fs:: { read_dir, symlink_metadata} ,
1211 path:: PathBuf ,
9998 }
10099 Ok ( entries) => entries,
101100 }
102- . filter_map ( |entry| match entry {
103- Err ( error) => {
104- reporter. report ( Event :: EncounterError ( ErrorReport {
105- operation : AccessEntry ,
106- path,
107- error,
108- } ) ) ;
109- None
110- }
111- Ok ( entry) => entry. file_name ( ) . pipe ( OsStringDisplay :: from) . pipe ( Some ) ,
112- } )
101+ . flatten ( )
102+ . map ( |entry| entry. file_name ( ) )
103+ . map ( OsStringDisplay :: from)
113104 . collect ( )
114105 } else {
115106 Vec :: new ( )
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ pub enum Operation {
55 SymlinkMetadata ,
66 /// Error is caused by calling [`std::fs::read_dir`].
77 ReadDirectory ,
8- /// Error when trying to access [`std::fs::DirEntry`] of one of the element of [`std::fs::read_dir`].
9- AccessEntry ,
108}
119
1210impl Operation {
@@ -16,7 +14,6 @@ impl Operation {
1614 match self {
1715 SymlinkMetadata => "symlink_metadata" ,
1816 ReadDirectory => "read_dir" ,
19- AccessEntry => "access entry" ,
2017 }
2118 }
2219}
@@ -36,5 +33,4 @@ mod test_operation {
3633
3734 name_display ! ( symlink_metadata, SymlinkMetadata , "symlink_metadata" ) ;
3835 name_display ! ( read_directory, ReadDirectory , "read_dir" ) ;
39- name_display ! ( access_entry, AccessEntry , "access entry" ) ;
4036}
You can’t perform that action at this time.
0 commit comments