zst is not an archive format..

This commit is contained in:
Spyros Roum 2021-10-22 02:21:31 +03:00
parent 0ed6841865
commit bdf5090844
3 changed files with 5 additions and 4 deletions

View File

@ -11,7 +11,7 @@ use zip::{self, read::ZipFile, ZipArchive};
use crate::{
info,
utils::{self, dir_is_empty,strip_cur_dir, Bytes},
utils::{self, dir_is_empty, strip_cur_dir, Bytes},
};
use self::utf8::get_invalid_utf8_paths;

View File

@ -21,7 +21,7 @@ pub enum CompressionFormat {
impl CompressionFormat {
pub fn is_archive_format(&self) -> bool {
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zstd | Zip)
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip)
}
}

View File

@ -32,7 +32,7 @@ fn sanity_check_through_mime() {
let formats = [
"tar", "zip", "tar.gz", "tgz", "tbz", "tbz2", "txz", "tlz", "tlzma", "tzst", "tar.bz", "tar.bz2", "tar.lzma",
"tar.xz", "zst",
"tar.xz", "tar.zst",
];
let expected_mimes = [
@ -79,6 +79,7 @@ fn test_each_format() {
test_compressing_and_decompressing_archive("tar.xz");
test_compressing_and_decompressing_archive("tar.lz");
test_compressing_and_decompressing_archive("tar.lzma");
test_compressing_and_decompressing_archive("tar.zst");
test_compressing_and_decompressing_archive("tgz");
test_compressing_and_decompressing_archive("tbz");
test_compressing_and_decompressing_archive("tbz2");
@ -96,7 +97,7 @@ fn test_each_format() {
// Why not
test_compressing_and_decompressing_archive(
"tar.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz",
"tar.gz.gz.gz.gz.gz.gz.gz.gz.zst.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz",
);
}