fn find_unpack_dir(in_dir: &Path) -> Fallible<PathBuf> {
    let dirs: Vec<_> = read_dir_eager(in_dir)
        .with_context(|_| ErrorDetails::PackageUnpackError)?
        .collect();

    // if there is only one directory, return that
    if let [(entry, metadata)] = dirs.as_slice() {
        if metadata.is_dir() {
            return Ok(entry.path().to_path_buf());
        }
    }
    // there is more than just a single directory here, something is wrong
    Err(ErrorDetails::PackageUnpackError.into())
}
/// Figure out the unpacked package directory name dynamically
///
/// Packages typically extract to a "package" directory, but not always
Figure out the unpacked package directory name dynamically
Packages typically extract to a "package" directory, but not always
Figure out the unpacked package directory name dynamically Packages typically extract to a " package " directory but not always
fn find_unpack_dir(in_dir: &Path) -> Fallible<PathBuf> {
    let dirs: Vec<_> = read_dir_eager(in_dir)
        .with_context(|_| ErrorDetails::PackageUnpackError)?
        .collect();
    // if there is only one directory, return that
    if let [(entry, metadata)] = dirs.as_slice() {
        if metadata.is_dir() {
            return Ok(entry.path().to_path_buf());
        }
    }
    // there is more than just a single directory here, something is wrong
    Err(ErrorDetails::PackageUnpackError.into())
}
fn find_unpack_dir ( in_dir : & Path ) -> Fallible < PathBuf > { let dirs : Vec < _ > = read_dir_eager ( in_dir ) . with_context ( | _ | ErrorDetails :: PackageUnpackError ) ? . collect ( ) ; // if there is only one directory, return that if let [ ( entry , metadata ) ] = dirs . as_slice ( ) { if metadata . is_dir ( ) { return Ok ( entry . path ( ) . to_path_buf ( ) ) ; } } // there is more than just a single directory here, something is wrong Err ( ErrorDetails :: PackageUnpackError . into ( ) ) }
Figure out the unpacked package directory name dynamically
Packages typically extract to a "package" directory, but not always
Figure out the unpacked package directory name dynamically Packages typically extract to a " package " directory but not always
in_dir
&Path