fn read_directory_rec(path: &Path) -> Result<HashMap<String, Vec<u8>>, IoError> {
    let mut result = HashMap::with_capacity(8);

    for entry in read_dir(path)? {
        let file = entry?.path();
        if file.is_file() {
            let file = read_file(&file)?;
            result.insert(format!("/{}", file.0), file.1);
        } else {
            let map = read_directory_rec(&file)?;
            for f in map {
                result.insert(format!("/{}{}", file_or_dir_name(&file)?, f.0), f.1);
            }
        }
    }
    Ok(result)
}
/// Reads a specific file recursively from the path into Memory
Reads a specific file recursively from the path into Memory
Reads a specific file recursively from the path into Memory
fn read_directory_rec(path: &Path) -> Result<HashMap<String, Vec<u8>>, IoError> {
    let mut result = HashMap::with_capacity(8);
    for entry in read_dir(path)? {
        let file = entry?.path();
        if file.is_file() {
            let file = read_file(&file)?;
            result.insert(format!("/{}", file.0), file.1);
        } else {
            let map = read_directory_rec(&file)?;
            for f in map {
                result.insert(format!("/{}{}", file_or_dir_name(&file)?, f.0), f.1);
            }
        }
    }
    Ok(result)
}
fn read_directory_rec ( path : & Path ) -> Result < HashMap < String , Vec < u8 > > , IoError > { let mut result = HashMap :: with_capacity ( 8 ) ; for entry in read_dir ( path ) ? { let file = entry ? . path ( ) ; if file . is_file ( ) { let file = read_file ( & file ) ? ; result . insert ( format ! ( " " file 0 ) , file . 1 ) ; } else { let map = read_directory_rec ( & file ) ? ; for f in map { result . insert ( format ! ( " " file_or_dir_name ( file ) f 0 ) , f . 1 ) ; } } } Ok ( result ) }
Reads a specific file recursively from the path into Memory
Reads a specific file recursively from the path into Memory
path
&Path
path
&Path