Skip to content

Conversation

steschu77
Copy link
Contributor

  • Fixes CI clippy warnings about reimplementing div_ceil
  • Should make CI green again

* Fixes CI clippy warnings
@fintelia fintelia merged commit 93baf7d into image-rs:main May 15, 2025
7 checks passed
@fintelia
Copy link
Contributor

Thanks!

@Shnatsel
Copy link
Member

Shnatsel commented Jun 2, 2025

I hope this didn't regress performance. Applying similar transformations suggested by Clippy had caused significant performance regressions in the past, for example

image-webp/src/vp8.rs

Lines 994 to 999 in 93baf7d

// Clippy suggests the clamp method, but it seems to optimize worse as of rustc 1.82.0 nightly.
#[allow(clippy::manual_clamp)]
fn clip(v: i32) -> u8 {
const YUV_FIX2: i32 = 6;
(v >> YUV_FIX2).max(0).min(255) as u8
}

@Shnatsel
Copy link
Member

Shnatsel commented Jun 2, 2025

On second look, none of these calculations are in hot loops, so performance should be unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants