mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-01 01:21:06 +03:00
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:
@@ -303,16 +303,9 @@ fn get_ext(name: &str) -> &str {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_compressed_file(name: &str) -> bool {
|
fn is_compressed_file(name: &str) -> bool {
|
||||||
|
let compressed_exts = ["xz", "gz", "zip", "7z", "rar", "bz2", "tgz", "png", "jpg"];
|
||||||
let ext = get_ext(name);
|
let ext = get_ext(name);
|
||||||
ext == "xz"
|
compressed_exts.contains(&ext)
|
||||||
|| ext == "gz"
|
|
||||||
|| ext == "zip"
|
|
||||||
|| ext == "7z"
|
|
||||||
|| ext == "rar"
|
|
||||||
|| ext == "bz2"
|
|
||||||
|| ext == "tgz"
|
|
||||||
|| ext == "png"
|
|
||||||
|| ext == "jpg"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TransferJob {
|
impl TransferJob {
|
||||||
|
|||||||
Reference in New Issue
Block a user