From 16ab577d1243f371bccd60b04f5e682ecb42262f Mon Sep 17 00:00:00 2001 From: Tanish Manku Date: Fri, 6 Nov 2026 19:34:32 -0700 Subject: [PATCH] fix(lint): as_chunks instead of constant-size chunks_exact (clippy 1.99, fails CI on main too) --- crates/svg/src/lib.rs | 4 ++-- src/icons.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/svg/src/lib.rs b/crates/svg/src/lib.rs index cbe48d88..0101cced 100644 --- a/crates/svg/src/lib.rs +++ b/crates/svg/src/lib.rs @@ -610,8 +610,8 @@ impl<'a> Builder<'a> { "polyline" | "polygon" => { let n = numbers(el.attr("points").unwrap_or("")); let mut p = Path::new(); - for (i, xy) in n.chunks_exact(2).enumerate() { - let q = Vec2::new(xy.first().copied().unwrap_or(0.0), xy.get(1).copied().unwrap_or(0.0)); + for (i, &[x, y]) in n.as_chunks::<2>().0.iter().enumerate() { + let q = Vec2::new(x, y); if i == 0 { p.move_to(q) } else { p.line_to(q) }; } if name == "polygon" && !p.is_empty() { diff --git a/src/icons.rs b/src/icons.rs index c030237a..51f5ad7d 100644 --- a/src/icons.rs +++ b/src/icons.rs @@ -202,8 +202,8 @@ fn num(tag: &str, name: &str) -> f32 { fn points(tag: &str, close: bool) -> Option { let v: Vec = attr(tag, "points")?.split(|c: char| c.is_whitespace() || c == ',').filter_map(|t| t.parse().ok()).collect(); let mut p = Path::new(); - for (i, xy) in v.chunks_exact(2).enumerate() { - let q = Vec2::new(xy[0], xy[1]); + for (i, &[x, y]) in v.as_chunks::<2>().0.iter().enumerate() { + let q = Vec2::new(x, y); if i == 0 { p.move_to(q); } else {