diff options
author | Canop <cano.petrole@gmail.com> | 2024-10-20 18:52:44 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2024-10-20 18:52:44 +0200 |
commit | bb0342d591b4a2d0bc2a3bb30b065c6fdf8e2e10 (patch) | |
tree | 20bd13ed5f07c9d8d91d2d08575f08053894ef89 | |
parent | ee170aa289b1ed5e79a5123a26ec24fad233e0c2 (diff) |
clippy...clean-kitty-temp-files
-rw-r--r-- | src/kitty/image_renderer.rs | 4 | ||||
-rw-r--r-- | 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, |