pub fn extract_tar_gz_into_dir(tar_gz_path: &Path, target_dir: &Path) -> FileDownloadResult<()> {
    let map_to_untar_error = |e| FileDownloadError::untar_error(tar_gz_path, e);

    let tar_gz_file =
        File::open(tar_gz_path).map_err(|e| FileDownloadError::file_open_error(tar_gz_path, e))?;

    let tar = GzDecoder::new(tar_gz_file);
    let mut archive = Archive::new(tar);
    archive.unpack(target_dir).map_err(map_to_untar_error)?;
    Ok(())
}
/// Extract the contents of a given .tar.gz file into `target_dir`
Extract the contents of a given .tar.gz file into `target_dir`
Extract the contents of a given . tar . gz file into ` target_dir `
pub fn extract_tar_gz_into_dir(tar_gz_path: &Path, target_dir: &Path) -> FileDownloadResult<()> {
    let map_to_untar_error = |e| FileDownloadError::untar_error(tar_gz_path, e);
    let tar_gz_file =
        File::open(tar_gz_path).map_err(|e| FileDownloadError::file_open_error(tar_gz_path, e))?;
    let tar = GzDecoder::new(tar_gz_file);
    let mut archive = Archive::new(tar);
    archive.unpack(target_dir).map_err(map_to_untar_error)?;
    Ok(())
}
pub fn extract_tar_gz_into_dir ( tar_gz_path : & Path , target_dir : & Path ) -> FileDownloadResult < ( ) > { let map_to_untar_error = | e | FileDownloadError :: untar_error ( tar_gz_path , e ) ; let tar_gz_file = File :: open ( tar_gz_path ) . map_err ( | e | FileDownloadError :: file_open_error ( tar_gz_path , e ) ) ? ; let tar = GzDecoder :: new ( tar_gz_file ) ; let mut archive = Archive :: new ( tar ) ; archive . unpack ( target_dir ) . map_err ( map_to_untar_error ) ? ; Ok ( ( ) ) }
Extract the contents of a given .tar.gz file into `target_dir`
Extract the contents of a given . tar . gz file into ` target_dir `
tar_gz_path
&Path
target_dir
&Path
tar_gz_path
&Path
target_dir
&Path