Skip to content

Commit

Permalink
FIX 9919c72: add doc comment, remove accidentally doubled is_archive()
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonHermann committed Nov 1, 2021
1 parent 9919c72 commit 8527616
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/archive/tar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn Read>) -> crate::Result<Vec<FileInArchive>> {
let mut archive = tar::Archive::new(reader);

Expand Down
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> {
let not_archives: Vec<PathBuf> = 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();

Expand Down
5 changes: 0 additions & 5 deletions src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
//
Expand Down

0 comments on commit 8527616

Please sign in to comment.