From 508fafd92d9a8a0b0e853d54901929d5f74f100e Mon Sep 17 00:00:00 2001 From: callmeBalloch <12576795+callmeBalloch@users.noreply.github.com> Date: Thu, 8 Oct 2026 19:13:50 +0000 Subject: [PATCH] AF.3: compare image sizes as the unsigned values they are Clippy (-D warnings) flagged an always-false comparison and a no-op cast in the Affinity image resampler after Rect::width became u32. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GQPh8UDgMyARR5Hat9UchC --- crates/io/src/affinity.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/io/src/affinity.rs b/crates/io/src/affinity.rs index d34c4755021..0ee9f2a9420 100644 --- a/crates/io/src/affinity.rs +++ b/crates/io/src/affinity.rs @@ -535,10 +535,10 @@ impl Builder { let format = if channels == 1 { PixelFormat::GRAY8 } else { self.format }; let mut out = if channels == 1 { Surface::with_default(format, &[0.0]) } else { Surface::new(format) }; let r = self.bbox(m, af::Rect { x0: 0.0, y0: 0.0, x1: f64::from(w), y1: f64::from(h) }); - if r.width() <= 0 || r.height() <= 0 { + if r.width() == 0 || r.height() == 0 { return Some(out); } - if u64::from(r.width() as u32) * u64::from(r.height() as u32) > MAX_PIXELS { + if u64::from(r.width()) * u64::from(r.height()) > MAX_PIXELS { self.warn("images larger than 64 megapixels on the canvas were left out"); return None; }