mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 19:45:29 +00:00
small cleanups
This commit is contained in:
parent
4bea6af526
commit
8023a9157e
@ -26,6 +26,7 @@ lz4_flex = "0.11.1"
|
|||||||
once_cell = "1.18.0"
|
once_cell = "1.18.0"
|
||||||
rayon = "1.8.0"
|
rayon = "1.8.0"
|
||||||
same-file = "1.0.6"
|
same-file = "1.0.6"
|
||||||
|
sevenz-rust = {version = "0.2.10", features = ["compress"]}
|
||||||
snap = "1.1.0"
|
snap = "1.1.0"
|
||||||
tar = "0.4.40"
|
tar = "0.4.40"
|
||||||
tempfile = "3.8.1"
|
tempfile = "3.8.1"
|
||||||
|
@ -95,17 +95,17 @@ pub fn list_archive_contents(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut a = Vec::new();
|
let mut files = Vec::new();
|
||||||
|
|
||||||
sevenz_rust::decompress_file_with_extract_fn(archive_path, ".", |entry, _, _| {
|
sevenz_rust::decompress_file_with_extract_fn(archive_path, ".", |entry, _, _| {
|
||||||
a.push(Ok(FileInArchive {
|
files.push(Ok(FileInArchive {
|
||||||
path: entry.name().into(),
|
path: entry.name().into(),
|
||||||
is_dir: entry.is_directory(),
|
is_dir: entry.is_directory(),
|
||||||
}));
|
}));
|
||||||
Ok(true)
|
Ok(true)
|
||||||
})
|
})
|
||||||
.map_err(crate::Error::SevenzipError)?;
|
.map_err(crate::Error::SevenzipError)?;
|
||||||
Box::new(a.into_iter())
|
Box::new(files.into_iter())
|
||||||
}
|
}
|
||||||
Gzip | Bzip | Lz4 | Lzma | Snappy | Zstd => {
|
Gzip | Bzip | Lz4 | Lzma | Snappy | Zstd => {
|
||||||
panic!("Not an archive! This should never happen, if it does, something is wrong with `CompressionFormat::is_archive()`. Please report this error!");
|
panic!("Not an archive! This should never happen, if it does, something is wrong with `CompressionFormat::is_archive()`. Please report this error!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user