fn list_files<P: AsRef<Path>>(path: P) -> std::io::Result<Vec<PathBuf>> {
        fs::read_dir(path)?
            .filter_map(|entry| entry.ok())
            .try_fold(vec![], |mut ret, entry| {
                entry.file_type().map(|ftype| {
                    if ftype.is_file() {
                        ret.push(entry.path());
                    }
                    ret
                })
            })
    }
/// List files in path, filtering out directories
List files in path, filtering out directories
List files in path filtering out directories
fn list_files<P: AsRef<Path>>(path: P) -> std::io::Result<Vec<PathBuf>> {
        fs::read_dir(path)?
            .filter_map(|entry| entry.ok())
            .try_fold(vec![], |mut ret, entry| {
                entry.file_type().map(|ftype| {
                    if ftype.is_file() {
                        ret.push(entry.path());
                    }
                    ret
                })
            })
    }
fn list_files < P : AsRef < Path > > ( path : P ) -> std :: io :: Result < Vec < PathBuf > > { fs :: read_dir ( path ) ? . filter_map ( | entry | entry . ok ( ) ) . try_fold ( vec ! [ ] , | mut ret , entry | { entry . file_type ( ) . map ( | ftype | { if ftype . is_file ( ) { ret . push ( entry . path ( ) ) ; } ret } ) } ) }
List files in path, filtering out directories
List files in path filtering out directories
path
P
path
P