fn visit_dir<'s, 'w, F>(
        &'s self,
        path: Path,
        scope: &Scope<'w>,
        level: usize,
        state: &'w WalkState<F>,
    ) where
        F: Fn(Path) + Sync + Send,
        's: 'w,
    {
        if level < self.depth && self.path_selector.matches_dir(&path) {
            match std::fs::read_dir(path.to_path_buf()) {
                Ok(rd) => {
                    for entry in Self::sorted_entries(path, rd) {
                        scope.spawn(move |s| self.visit_entry(entry, s, level + 1, state))
                    }
                }
                Err(e) => self.log_warn(format!("Failed to read dir {}: {}", path.display(), e)),
            }
        }
    }
/// Reads the contents of the directory pointed to by `path`
/// and recursively visits each child entry
Reads the contents of the directory pointed to by `path`
and recursively visits each child entry
Reads the contents of the directory pointed to by ` path ` and recursively visits each child entry
fn visit_dir<'s, 'w, F>(
        &'s self,
        path: Path,
        scope: &Scope<'w>,
        level: usize,
        state: &'w WalkState<F>,
    ) where
        F: Fn(Path) + Sync + Send,
        's: 'w,
    {
        if level < self.depth && self.path_selector.matches_dir(&path) {
            match std::fs::read_dir(path.to_path_buf()) {
                Ok(rd) => {
                    for entry in Self::sorted_entries(path, rd) {
                        scope.spawn(move |s| self.visit_entry(entry, s, level + 1, state))
                    }
                }
                Err(e) => self.log_warn(format!("Failed to read dir {}: {}", path.display(), e)),
            }
        }
    }
fn visit_dir < ' s , ' w , F > ( & ' s self , path : Path , scope : & Scope < ' w > , level : usize , state : & ' w WalkState < F > , ) where F : Fn ( Path ) + Sync + Send , ' s : ' w , { if level < self . depth && self . path_selector . matches_dir ( & path ) { match std :: fs :: read_dir ( path . to_path_buf ( ) ) { Ok ( rd ) => { for entry in Self :: sorted_entries ( path , rd ) { scope . spawn ( move | s | self . visit_entry ( entry , s , level + 1 , state ) ) } } Err ( e ) => self . log_warn ( format ! ( " " path display ( ) e ) ) , } } }
Reads the contents of the directory pointed to by `path`
and recursively visits each child entry
Reads the contents of the directory pointed to by ` path ` and recursively visits each child entry
&'s self
path
Path
scope
&Scope<'w>
level
usize
state
&'w WalkState<F>
&'s self
path
Path
scope
&Scope<'w>
level
usize
state
&'w WalkState<F>