From 92a2d2de717c280fe8559c2b3042d91e463c056c Mon Sep 17 00:00:00 2001 From: Taha-Mahmoodi <85902429+Taha-Mahmoodi@users.noreply.github.com> Date: Tue, 17 Nov 2026 16:48:13 +0430 Subject: [PATCH] Fix clippy on macOS with current stable: dead_code on Overrides::is_set, needless_range_loop in cut_edge Overrides::is_set is only called from main under cfg(not(macos)), so it is allowed to be unused there (the repo's cfg_attr pattern). settle_cut_edges walks blended with iter_mut().enumerate() instead of indexing it. --- apps/vectorcraft/src/presentation.rs | 1 + crates/trace/src/quantize/cut_edge.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/vectorcraft/src/presentation.rs b/apps/vectorcraft/src/presentation.rs index 3910984c93..7c2f1dc48a 100644 --- a/apps/vectorcraft/src/presentation.rs +++ b/apps/vectorcraft/src/presentation.rs @@ -54,6 +54,7 @@ fn flag_value(flag: &str, arg: &str, args: &mut impl Iterator) -> impl Overrides { /// Whether a flag or a variable set the present mode or the frame latency. + #[cfg_attr(target_os = "macos", allow(dead_code))] // its one caller, in `main`, is not built on macOS pub fn is_set(&self) -> bool { *self != Self::default() } diff --git a/crates/trace/src/quantize/cut_edge.rs b/crates/trace/src/quantize/cut_edge.rs index 61a9db4c8e..4e32856ef1 100644 --- a/crates/trace/src/quantize/cut_edge.rs +++ b/crates/trace/src/quantize/cut_edge.rs @@ -607,7 +607,7 @@ pub(crate) fn settle_cut_edges(q: &mut Quantized, img: &Raster, gray: bool) -> V let edge = cut_edge(img); let mut changed = false; let mut stack: Vec<(usize, usize)> = Vec::new(); - for i in 0..w * h { + for (i, blend) in blended.iter_mut().enumerate() { let mine = q.labels[i]; if mine == TRANSPARENT || !edge.get(i).copied().unwrap_or(false) { continue; @@ -630,7 +630,7 @@ pub(crate) fn settle_cut_edges(q: &mut Quantized, img: &Raster, gray: bool) -> V } } }); - blended[i] = !near.is_empty(); + *blend = !near.is_empty(); if keep || near.is_empty() { continue; }