hbb_common: simplify is_compressed_file (#10436)

* hbb_common: simplify is_compressed_file

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>

* `exts` rename to `compressed_exts`

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
This commit is contained in:
Xiaobo Liu
2025-01-06 18:20:18 +08:00
committed by GitHub
parent 40999c3211
commit 0dbd3094ec

View File

@@ -303,16 +303,9 @@ fn get_ext(name: &str) -> &str {
#[inline]
fn is_compressed_file(name: &str) -> bool {
let compressed_exts = ["xz", "gz", "zip", "7z", "rar", "bz2", "tgz", "png", "jpg"];
let ext = get_ext(name);
ext == "xz"
|| ext == "gz"
|| ext == "zip"
|| ext == "7z"
|| ext == "rar"
|| ext == "bz2"
|| ext == "tgz"
|| ext == "png"
|| ext == "jpg"
compressed_exts.contains(&ext)
}
impl TransferJob {