summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2024-10-20 18:52:44 +0200
committerCanop <cano.petrole@gmail.com>2024-10-20 18:52:44 +0200
commitbb0342d591b4a2d0bc2a3bb30b065c6fdf8e2e10 (patch)
tree20bd13ed5f07c9d8d91d2d08575f08053894ef89
parentee170aa289b1ed5e79a5123a26ec24fad233e0c2 (diff)
-rw-r--r--src/kitty/image_renderer.rs4
-rw-r--r--src/kitty/mod.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/kitty/image_renderer.rs b/src/kitty/image_renderer.rs
index ca5f8d2..db2d8d4 100644
--- a/src/kitty/image_renderer.rs
+++ b/src/kitty/image_renderer.rs
@@ -225,7 +225,7 @@ impl KittyImageRenderer {
if !is_kitty_graphics_protocol_supported() {
return None;
}
- let hasher = FxBuildHasher::default();
+ let hasher = FxBuildHasher;
let temp_files = LruCache::with_hasher(options.kept_temp_files, hasher);
cell_size_in_pixels()
.ok()
@@ -240,7 +240,7 @@ impl KittyImageRenderer {
pub fn delete_temp_files(&mut self) {
for (_, temp_file_path) in self.temp_files.into_iter() {
debug!("removing temp file: {:?}", temp_file_path);
- if let Err(e) = std::fs::remove_file(&temp_file_path) {
+ if let Err(e) = std::fs::remove_file(temp_file_path) {
error!("failed to remove temp file: {:?}", e);
}
}
diff --git a/src/kitty/mod.rs b/src/kitty/mod.rs
index d3aeade..e20e953 100644
--- a/src/kitty/mod.rs
+++ b/src/kitty/mod.rs
@@ -67,9 +67,8 @@ impl KittyManager {
}
}
pub fn delete_temp_files(&mut self) {
- match &mut self.renderer {
- MaybeRenderer::Enabled { renderer } => renderer.delete_temp_files(),
- _ => {}
+ if let MaybeRenderer::Enabled { renderer } = &mut self.renderer {
+ renderer.delete_temp_files();
}
}
pub fn renderer(
@@ -108,6 +107,7 @@ impl KittyManager {
}
}
}
+ #[allow(clippy::too_many_arguments)] // yes, I know
pub fn try_print_image(
&mut self,
w: &mut W,