mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-08 04:25:31 +00:00
FIX 9919c72: add doc comment, remove accidentally doubled is_archive()
This commit is contained in:
parent
9919c72347
commit
8527616729
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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::*;
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user