/// Walks the `root` directory and returns all files with a `.ditto` extension.
Walks the `root` directory and returns all files with a `.ditto` extension.
Walks the ` root ` directory and returns all files with a ` . ditto ` extension .
pub fn find_ditto_files<P: AsRef<Path>>(root: P) -> io::Result<Vec<PathBuf>> {
    let mut files = Vec::new();
    for entry in WalkDir::new(root) {
        let entry = entry?;
        if entry.file_type().is_file() {
            let path = entry.path();
            if path.extension() == Some(OsStr::new("ditto")) {
                files.push(path.to_path_buf())
            }
        }
    }
    Ok(files)
}
pub fn find_ditto_files < P : AsRef < Path > > ( root : P ) -> io :: Result < Vec < PathBuf > > { let mut files = Vec :: new ( ) ; for entry in WalkDir :: new ( root ) { let entry = entry ? ; if entry . file_type ( ) . is_file ( ) { let path = entry . path ( ) ; if path . extension ( ) == Some ( OsStr :: new ( " " ) ) { files . push ( path . to_path_buf ( ) ) } } } Ok ( files ) }
Walks the `root` directory and returns all files with a `.ditto` extension.
Walks the ` root ` directory and returns all files with a ` . ditto ` extension .
root
P