fn visit_dirs(dir: &Path, cb: &mut FnMut(&fs::DirEntry)) -> io::Result<()> {
    if dir.is_dir() {
        for entry in fs::read_dir(dir)? {
            let entry = entry?;
            let path = entry.path();
            if path.is_dir() {
                visit_dirs(&path, cb)?;
            } else {
                cb(&entry);
            }
        }
    }
    Ok(())
}
// Source at the documentation for DirEntry.
Source at the documentation for DirEntry.
Source at the documentation for DirEntry .
fn visit_dirs(dir: &Path, cb: &mut FnMut(&fs::DirEntry)) -> io::Result<()> {
    if dir.is_dir() {
        for entry in fs::read_dir(dir)? {
            let entry = entry?;
            let path = entry.path();
            if path.is_dir() {
                visit_dirs(&path, cb)?;
            } else {
                cb(&entry);
            }
        }
    }
    Ok(())
}
fn visit_dirs ( dir : & Path , cb : & mut FnMut ( & fs :: DirEntry ) ) -> io :: Result < ( ) > { if dir . is_dir ( ) { for entry in fs :: read_dir ( dir ) ? { let entry = entry ? ; let path = entry . path ( ) ; if path . is_dir ( ) { visit_dirs ( & path , cb ) ? ; } else { cb ( & entry ) ; } } } Ok ( ( ) ) }
Source at the documentation for DirEntry.
Source at the documentation for DirEntry .
dir
&Path
cb
&mut FnMut(&fs::DirEntry)
dir
&Path
cb
&mut FnMut(&fs::DirEntry)