Skip to content

Commit

Permalink
Run clippy on the code base (#180)
Browse files Browse the repository at this point in the history
Co-authored-by: AzHicham <[email protected]>
  • Loading branch information
AzHicham and AzHicham authored Nov 15, 2024
1 parent c2b03b7 commit eae096f
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 eae096f

@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: eae096f Previous: c2b03b7 Ratio
philips_i2syntax_read_region_256_lvl_0 1365606 ns/iter (± 69957) 1381819 ns/iter (± 144933) 0.99
philips_i2syntax_read_region_256_lvl_1 1164600 ns/iter (± 39012) 1182079 ns/iter (± 73302) 0.99
philips_i2syntax_read_region_512_lvl_0 1586248 ns/iter (± 61917) 1581996 ns/iter (± 146351) 1.00
philips_i2syntax_read_region_512_lvl_1 7513885 ns/iter (± 224931) 7422209 ns/iter (± 471053) 1.01
philips_read_region_256_lvl_0 531585 ns/iter (± 43219) 519801 ns/iter (± 55304) 1.02
philips_read_region_256_lvl_1 1270822 ns/iter (± 50250) 1263448 ns/iter (± 75163) 1.01
philips_read_region_512_lvl_0 3640251 ns/iter (± 112788) 3603442 ns/iter (± 337247) 1.01
philips_read_region_512_lvl_1 3194574 ns/iter (± 114073) 2844287 ns/iter (± 166564) 1.12

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.

philips-isyntax-rs Benchmark

Benchmark suite Current: eae096f Previous: c2b03b7 Ratio
philips_i2syntax_read_region_256_lvl_0 1337550 ns/iter (± 57680) 1381819 ns/iter (± 144933) 0.97
philips_i2syntax_read_region_256_lvl_1 1154055 ns/iter (± 233120) 1182079 ns/iter (± 73302) 0.98
philips_i2syntax_read_region_512_lvl_0 1557381 ns/iter (± 450999) 1581996 ns/iter (± 146351) 0.98
philips_i2syntax_read_region_512_lvl_1 7456867 ns/iter (± 298726) 7422209 ns/iter (± 471053) 1.00
philips_read_region_256_lvl_0 489883 ns/iter (± 47536) 519801 ns/iter (± 55304) 0.94
philips_read_region_256_lvl_1 1227216 ns/iter (± 43869) 1263448 ns/iter (± 75163) 0.97
philips_read_region_512_lvl_0 3498759 ns/iter (± 200474) 3603442 ns/iter (± 337247) 0.97
philips_read_region_512_lvl_1 2706288 ns/iter (± 122856) 2844287 ns/iter (± 166564) 0.95

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

Please sign in to comment.