fn list_dirs_in(dir: impl AsRef<Utf8Path>) -> Result<Vec<Utf8PathBuf>> {
    let mut dirs = Vec::new();
    let paths = fs::read_dir(dir.as_ref())?;
    for path in paths.flatten() {
        if let Some(path) = Utf8Path::from_path(&path.path()) {
            if path.is_dir() && path.join("Cargo.toml").exists() {
                dirs.push(path.to_path_buf());
            }
        }
    }
    Ok(dirs)
}
/// Get all directories below the given directory.
Get all directories below the given directory.
Get all directories below the given directory .
fn list_dirs_in(dir: impl AsRef<Utf8Path>) -> Result<Vec<Utf8PathBuf>> {
    let mut dirs = Vec::new();
    let paths = fs::read_dir(dir.as_ref())?;
    for path in paths.flatten() {
        if let Some(path) = Utf8Path::from_path(&path.path()) {
            if path.is_dir() && path.join("Cargo.toml").exists() {
                dirs.push(path.to_path_buf());
            }
        }
    }
    Ok(dirs)
}
fn list_dirs_in ( dir : impl AsRef < Utf8Path > ) -> Result < Vec < Utf8PathBuf > > { let mut dirs = Vec :: new ( ) ; let paths = fs :: read_dir ( dir . as_ref ( ) ) ? ; for path in paths . flatten ( ) { if let Some ( path ) = Utf8Path :: from_path ( & path . path ( ) ) { if path . is_dir ( ) && path . join ( " " ) . exists ( ) { dirs . push ( path . to_path_buf ( ) ) ; } } } Ok ( dirs ) }
Get all directories below the given directory.
Get all directories below the given directory .
dir
impl AsRef<Utf8Path>