From 8023a9157ea9faaa0d25a69a9aa74fe7f8597dae Mon Sep 17 00:00:00 2001 From: figsoda Date: Wed, 24 May 2023 10:54:39 -0400 Subject: [PATCH] small cleanups --- Cargo.toml | 1 + src/commands/list.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1e475bb..82bb09c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/commands/list.rs b/src/commands/list.rs index cbf20a6..0fdaa52 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -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!");