mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +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"
|
||||
rayon = "1.8.0"
|
||||
same-file = "1.0.6"
|
||||
sevenz-rust = {version = "0.2.10", features = ["compress"]}
|
||||
snap = "1.1.0"
|
||||
tar = "0.4.40"
|
||||
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, _, _| {
|
||||
a.push(Ok(FileInArchive {
|
||||
files.push(Ok(FileInArchive {
|
||||
path: entry.name().into(),
|
||||
is_dir: entry.is_directory(),
|
||||
}));
|
||||
Ok(true)
|
||||
})
|
||||
.map_err(crate::Error::SevenzipError)?;
|
||||
Box::new(a.into_iter())
|
||||
Box::new(files.into_iter())
|
||||
}
|
||||
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!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user