Skip to content

Commit 492b68a

Browse files
committed
Do not use tree_magic_mini because it sometimes don't recognize gzip files
1 parent 5ed1685 commit 492b68a

File tree

3 files changed

+3
-56
lines changed

3 files changed

+3
-56
lines changed

Cargo.lock

-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ mime = "0.3"
1919
mime_guess = "2.0"
2020
num-format = { version = "0.4", features = ["with-system-locale"] }
2121
ratatui = "0.29"
22-
tree_magic_mini = "3.1"
2322

2423
[profile.release]
2524
strip = "symbols"

src/mainloop.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,9 @@ impl Mainloop {
5454

5555
let image_path = Path::new(&args.image);
5656
let image_basename = image_path.file_name().unwrap().to_string_lossy().to_string();
57-
58-
let image_mime_type = match args.from_drive {
59-
false => tree_magic_mini::from_filepath(image_path)
60-
.unwrap_or(mime::APPLICATION_OCTET_STREAM.as_ref())
61-
.parse().unwrap(),
62-
true => mime_guess::from_ext(
63-
&image_path.extension().unwrap_or_default().to_string_lossy())
64-
.first_or_octet_stream(),
65-
};
57+
let image_mime_type = mime_guess::from_ext(
58+
&image_path.extension().unwrap_or_default().to_string_lossy())
59+
.first_or_octet_stream();
6660

6761
Self {
6862
args: args.clone(),

0 commit comments

Comments
 (0)