Skip to content

Commit

Permalink
Run clippy on the code base (#159)
Browse files Browse the repository at this point in the history
Co-authored-by: AzHicham <[email protected]>
  • Loading branch information
AzHicham and AzHicham authored Sep 24, 2024
1 parent a3ea8d9 commit 5e3f7c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'a> View<'a> {
pub fn read_thumbnail(&self, engine: &PhilipsEngine, size: &Size) -> Result<RgbImage> {
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 {
Expand All @@ -144,7 +144,7 @@ impl<'a> View<'a> {
level: best_level,
};
let image = self.read_image(engine, &region_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)
}
Expand Down

1 comment on commit 5e3f7c7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

philips-isyntax-rs Benchmark

Benchmark suite Current: 5e3f7c7 Previous: 3227604 Ratio
philips_i2syntax_read_region_256_lvl_0 1357196 ns/iter (± 101131) 1364575 ns/iter (± 115355) 0.99
philips_i2syntax_read_region_256_lvl_1 1153920 ns/iter (± 40474) 1167734 ns/iter (± 43405) 0.99
philips_i2syntax_read_region_512_lvl_0 1552160 ns/iter (± 157166) 1561243 ns/iter (± 66932) 0.99
philips_i2syntax_read_region_512_lvl_1 7397925 ns/iter (± 462154) 7378150 ns/iter (± 456643) 1.00
philips_read_region_256_lvl_0 504592 ns/iter (± 40418) 508489 ns/iter (± 27276) 0.99
philips_read_region_256_lvl_1 1246456 ns/iter (± 46479) 1241770 ns/iter (± 55329) 1.00
philips_read_region_512_lvl_0 3500861 ns/iter (± 170397) 3625588 ns/iter (± 398970) 0.97
philips_read_region_512_lvl_1 2738046 ns/iter (± 125704) 2740300 ns/iter (± 152691) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.