From 8527616729626a5e9900090d87de5f88d19bb5bb Mon Sep 17 00:00:00 2001 From: Anton Hermann Date: Mon, 1 Nov 2021 12:40:30 +0100 Subject: [PATCH] FIX 9919c72: add doc comment, remove accidentally doubled is_archive() --- src/archive/tar.rs | 2 ++ src/commands.rs | 2 +- src/extension.rs | 5 ----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/archive/tar.rs b/src/archive/tar.rs index 739c4fc..a5c68b0 100644 --- a/src/archive/tar.rs +++ b/src/archive/tar.rs @@ -44,6 +44,8 @@ pub fn unpack_archive( Ok(files_unpacked) } + +/// List contents of `archive`, returning a vector of archive entries pub fn list_archive(reader: Box) -> crate::Result> { let mut archive = tar::Archive::new(reader); diff --git a/src/commands.rs b/src/commands.rs index a939998..0cc0775 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -192,7 +192,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> { let not_archives: Vec = files .iter() .zip(&formats) - .filter(|(_, formats)| formats.is_empty() || !formats[0].is_archive()) + .filter(|(_, formats)| formats.is_empty() || !formats[0].is_archive_format()) .map(|(path, _)| path.clone()) .collect(); diff --git a/src/extension.rs b/src/extension.rs index b603d89..3cd17d6 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -47,11 +47,6 @@ impl fmt::Display for CompressionFormat { ) } } -impl CompressionFormat { - pub fn is_archive(&self) -> bool { - matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip) - } -} // use crate::extension::CompressionFormat::*; //