pub fn dir_entry_match<T, F>(dir: &Path, mut f: F) -> io::Result<Vec<T>>
where
    F: FnMut(&DirEntry) -> Option<T>,
{
    let entries = read_dir_eager(dir)?;
    Ok(entries
        .filter(|(_, metadata)| metadata.is_file())
        .filter_map(|(entry, _)| f(&entry))
        .collect::<Vec<T>>())
}
/// Reads the contents of a directory and returns a Vec of the matched results
/// from the input function
Reads the contents of a directory and returns a Vec of the matched results
from the input function
Reads the contents of a directory and returns a Vec of the matched results from the input function
pub fn dir_entry_match<T, F>(dir: &Path, mut f: F) -> io::Result<Vec<T>>
where
    F: FnMut(&DirEntry) -> Option<T>,
{
    let entries = read_dir_eager(dir)?;
    Ok(entries
        .filter(|(_, metadata)| metadata.is_file())
        .filter_map(|(entry, _)| f(&entry))
        .collect::<Vec<T>>())
}
pub fn dir_entry_match < T , F > ( dir : & Path , mut f : F ) -> io :: Result < Vec < T > > where F : FnMut ( & DirEntry ) -> Option < T > , { let entries = read_dir_eager ( dir ) ? ; Ok ( entries . filter ( | ( _ , metadata ) | metadata . is_file ( ) ) . filter_map ( | ( entry , _ ) | f ( & entry ) ) . collect :: < Vec < T > > ( ) ) }
Reads the contents of a directory and returns a Vec of the matched results
from the input function
Reads the contents of a directory and returns a Vec of the matched results from the input function
dir
&Path
f
F
dir
&Path
f
F