From b00cb4533af191de874a4303c2f0a149d7ed299d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 15 Nov 2026 17:17:42 +0000 Subject: [PATCH] raw: use fixed-size opcode record chunks --- crates/raw/src/opcode_params.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/raw/src/opcode_params.rs b/crates/raw/src/opcode_params.rs index 4f2433269..7c6997c98 100644 --- a/crates/raw/src/opcode_params.rs +++ b/crates/raw/src/opcode_params.rs @@ -40,7 +40,7 @@ impl Area { pub struct PointRecords<'a>(&'a [u8]); impl PointRecords<'_> { pub fn iter(&self) -> impl Iterator + '_ { - self.0.chunks_exact(8).map(|b| (u32::from_be_bytes([b[0], b[1], b[2], b[3]]), u32::from_be_bytes([b[4], b[5], b[6], b[7]]))) + self.0.as_chunks::<8>().0.iter().map(|b| (u32::from_be_bytes([b[0], b[1], b[2], b[3]]), u32::from_be_bytes([b[4], b[5], b[6], b[7]]))) } } /// Borrowed bad-pixel rectangles, decoded lazily without copying the payload. @@ -48,7 +48,7 @@ impl PointRecords<'_> { pub struct RectangleRecords<'a>(&'a [u8]); impl RectangleRecords<'_> { pub fn iter(&self) -> impl Iterator + '_ { - self.0.chunks_exact(16).map(|b| { + self.0.as_chunks::<16>().0.iter().map(|b| { [ u32::from_be_bytes([b[0], b[1], b[2], b[3]]), u32::from_be_bytes([b[4], b[5], b[6], b[7]]),