Skip to content

Commit

Permalink
Run clippy on the code base (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: AzHicham <AzHicham@users.noreply.github.com>
  • Loading branch information
AzHicham and AzHicham authored Oct 20, 2024
1 parent 5e3f7c7 commit d06dd4b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ pub(crate) mod ffi {

// View properties
fn dimensionRanges(self: &ImageView, level: u32) -> Result<DimensionsRange>;
fn dimensionNames<'a>(self: &ImageView) -> &'a CxxVector<CxxString>;
fn dimensionUnits<'a>(self: &ImageView) -> &'a CxxVector<CxxString>;
fn dimensionTypes<'a>(self: &ImageView) -> &'a CxxVector<CxxString>;
fn scale<'a>(self: &ImageView) -> &'a CxxVector<f64>;
fn origin<'a>(self: &ImageView) -> &'a CxxVector<f64>;
fn dimensionNames(self: &ImageView) -> &CxxVector<CxxString>;
fn dimensionUnits(self: &ImageView) -> &CxxVector<CxxString>;
fn dimensionTypes(self: &ImageView) -> &CxxVector<CxxString>;
fn scale(self: &ImageView) -> &CxxVector<f64>;
fn origin(self: &ImageView) -> &CxxVector<f64>;
fn bitsAllocated(self: &ImageView) -> u16;
fn bitsStored(self: &ImageView) -> u16;
fn highBit(self: &ImageView) -> u16;
Expand Down
4 changes: 2 additions & 2 deletions src/facade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{ContainerName, Facade, Image, ImageType, Result};
use cxx::let_cxx_string;
use std::path::Path;

impl<'a> Drop for Facade<'a> {
impl Drop for Facade<'_> {
fn drop(&mut self) {
if let Err(_err) = self.close() {
// todo! log?
Expand All @@ -16,7 +16,7 @@ impl<'a> Drop for Facade<'a> {
/// A facade is a reference to a Philips Engine internal object
/// The facade allow file manipulation & file information retrieval
/// NOTE: Philips Engine and all internal objects are not thread safe
impl<'a> Facade<'a> {
impl Facade<'_> {
/// Open an ISyntax file through a facade and specify a cache file
/// if the container allows it
pub(crate) fn open_with_cache_file<P: AsRef<Path>, R: AsRef<Path>>(
Expand Down
2 changes: 1 addition & 1 deletion src/sub_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
std::io::Cursor,
};

impl<'a> Image<'a> {
impl Image<'_> {
/// Returns the pixel transform used for this Image
pub fn pixel_transform(&self) -> Result<&str> {
Ok(self.inner.pixelTransform()?.to_str()?)
Expand Down
2 changes: 1 addition & 1 deletion src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{DimensionsRange, PhilipsEngine, Rectangle, RegionRequest, Result, Si
#[cfg(feature = "image")]
use {crate::errors::ImageError, image::RgbImage};

impl<'a> View<'a> {
impl View<'_> {
/// Returns the dimension ranges of the SubImage for a certain level
/// For Macro and Label/ILE image this function return a result only for level 0
pub fn dimension_ranges(&self, level: u32) -> Result<DimensionsRange> {
Expand Down

2 comments on commit d06dd4b

@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: d06dd4b Previous: 132c667 Ratio
philips_i2syntax_read_region_256_lvl_0 1370877 ns/iter (± 299586) 1382074 ns/iter (± 101204) 0.99
philips_i2syntax_read_region_256_lvl_1 1416928 ns/iter (± 312692) 1177604 ns/iter (± 50886) 1.20
philips_i2syntax_read_region_512_lvl_0 1571182 ns/iter (± 518608) 1682424 ns/iter (± 71560) 0.93
philips_i2syntax_read_region_512_lvl_1 7502579 ns/iter (± 409265) 7612744 ns/iter (± 299313) 0.99
philips_read_region_256_lvl_0 511873 ns/iter (± 35896) 533197 ns/iter (± 45958) 0.96
philips_read_region_256_lvl_1 1265324 ns/iter (± 91860) 1264376 ns/iter (± 68238) 1.00
philips_read_region_512_lvl_0 3600539 ns/iter (± 127477) 3567126 ns/iter (± 289753) 1.01
philips_read_region_512_lvl_1 2786257 ns/iter (± 113783) 2757279 ns/iter (± 93814) 1.01

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'philips-isyntax-rs Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: d06dd4b Previous: 132c667 Ratio
philips_i2syntax_read_region_256_lvl_1 1416928 ns/iter (± 312692) 1177604 ns/iter (± 50886) 1.20

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

CC: @AzHicham

Please sign in to comment.