From 5e3f7c755e9c1e134b32feaec61ed2fc57da7724 Mon Sep 17 00:00:00 2001 From: Hicham Azimani Date: Tue, 24 Sep 2024 08:52:28 +0200 Subject: [PATCH] Run clippy on the code base (#159) Co-authored-by: AzHicham --- src/utils.rs | 4 ++-- src/view.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 16f5ebe..ef278ca 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,7 +1,7 @@ -use crate::{Result, Size}; +use crate::{errors::ImageError, Result, Size}; use fast_image_resize as fr; +use image::RgbImage; use std::cmp; -use {crate::errors::ImageError, image::RgbImage}; // Get the appropriate level for the given dimensions: i.e. the level with at least one // dimensions (i.e along one axis) greater than the dimension requested diff --git a/src/view.rs b/src/view.rs index fdae145..96a2a89 100644 --- a/src/view.rs +++ b/src/view.rs @@ -132,7 +132,7 @@ impl<'a> View<'a> { pub fn read_thumbnail(&self, engine: &PhilipsEngine, size: &Size) -> Result { let level_count = self.num_derived_levels() + 1; let dimension_level_0 = Size::try_from(&self.dimension_ranges(0)?)?; - let best_level = get_best_level_for_dimensions(&size, &dimension_level_0, level_count); + let best_level = get_best_level_for_dimensions(size, &dimension_level_0, level_count); let dimensions_range = self.dimension_ranges(best_level)?; let region_request = RegionRequest { roi: Rectangle { @@ -144,7 +144,7 @@ impl<'a> View<'a> { level: best_level, }; let image = self.read_image(engine, ®ion_request)?; - let final_size = preserve_aspect_ratio(&size, &Size::try_from(&dimensions_range)?); + let final_size = preserve_aspect_ratio(size, &Size::try_from(&dimensions_range)?); let image = resize_rgb_image(image, &final_size)?; Ok(image) }