fn list_dirs(path: &PathBuf) -> std::io::Result<Vec<PathBuf>> {
    // read_dir returning an iterator over Result<DirEntry>, there is first a conversion to a path
    // and then a check if the path is a directory or not.
    let dir_entries: std::io::Result<Vec<DirEntry>> = path.read_dir()?.collect();
    Ok(dir_entries?
        .iter()
        .map(|dir_entry| dir_entry.path())
        .filter(|dir_path| dir_path.is_dir())
        .collect())
}
/// Lists all the directory paths in the given directory path.
Lists all the directory paths in the given directory path.
Lists all the directory paths in the given directory path .
fn list_dirs(path: &PathBuf) -> std::io::Result<Vec<PathBuf>> {
    // read_dir returning an iterator over Result<DirEntry>, there is first a conversion to a path
    // and then a check if the path is a directory or not.
    let dir_entries: std::io::Result<Vec<DirEntry>> = path.read_dir()?.collect();
    Ok(dir_entries?
        .iter()
        .map(|dir_entry| dir_entry.path())
        .filter(|dir_path| dir_path.is_dir())
        .collect())
}
fn list_dirs ( path : & PathBuf ) -> std :: io :: Result < Vec < PathBuf > > { // read_dir returning an iterator over Result<DirEntry>, there is first a conversion to a path // and then a check if the path is a directory or not. let dir_entries : std :: io :: Result < Vec < DirEntry > > = path . read_dir ( ) ? . collect ( ) ; Ok ( dir_entries ? . iter ( ) . map ( | dir_entry | dir_entry . path ( ) ) . filter ( | dir_path | dir_path . is_dir ( ) ) . collect ( ) ) }
Lists all the directory paths in the given directory path.
Lists all the directory paths in the given directory path .
path
&PathBuf
path
&PathBuf