From 8d5c939e203fbbd7cd7543f0d4e79043b9a500a5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 17 Nov 2026 14:46:32 -0500 Subject: [PATCH] psd: use fixed-size guide chunks for strict clippy --- crates/psd/src/guides.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/psd/src/guides.rs b/crates/psd/src/guides.rs index f122c7805..2b654ec8f 100644 --- a/crates/psd/src/guides.rs +++ b/crates/psd/src/guides.rs @@ -27,7 +27,7 @@ impl GuideV1 { /// Encode a legacy resource header. Grid cycles and count are caller supplied. pub fn header_v1(horizontal_cycle: u32, vertical_cycle: u32, count: u32) -> [u8; 16] { let mut out = [0; 16]; - for (chunk, value) in out.chunks_exact_mut(4).zip([1u32, horizontal_cycle, vertical_cycle, count]) { + for (chunk, value) in out.as_chunks_mut::<4>().0.iter_mut().zip([1u32, horizontal_cycle, vertical_cycle, count]) { chunk.copy_from_slice(&value.to_be_bytes()); } out @@ -40,7 +40,9 @@ pub fn parse_v1_prefix(data: &[u8]) -> impl Iterator + '_ { let count = be_u32(data, 12).unwrap_or(0); data.get(16..) .unwrap_or_default() - .chunks_exact(5) + .as_chunks::<5>() + .0 + .iter() .zip(0..count) .map(|(g, _)| GuideV1 { location: i32::from_be_bytes([g[0], g[1], g[2], g[3]]), direction: g[4] }) }