From bb0342d591b4a2d0bc2a3bb30b065c6fdf8e2e10 Mon Sep 17 00:00:00 2001 From: Canop Date: Sun, 20 Oct 2024 18:52:44 +0200 Subject: clippy... --- src/kitty/image_renderer.rs | 4 ++-- src/kitty/mod.rs | 6 +++--- 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, -- cgit v1.2.3