From 9a7f30050f8efc52340e698031a7a55a105e72c4 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Sun, 30 Aug 2026 21:15:00 +0200 Subject: Use as_chunks for fixed-size pixel iteration --- crates/wayland/src/udev/render.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/wayland/src/udev/render.rs') diff --git a/crates/wayland/src/udev/render.rs b/crates/wayland/src/udev/render.rs index cefd759..83d721a 100644 --- a/crates/wayland/src/udev/render.rs +++ b/crates/wayland/src/udev/render.rs @@ -1532,7 +1532,7 @@ impl CompState { if map.len() < expected_bytes { return None; } - let read_channel = |offset: usize| -> Vec { map[offset..offset + size * 2].chunks_exact(2).map(|b| u16::from_ne_bytes([b[0], b[1]])).collect() }; + let read_channel = |offset: usize| -> Vec { map[offset..offset + size * 2].as_chunks::<2>().0.iter().map(|b| u16::from_ne_bytes(*b)).collect() }; let red = read_channel(0); let green = read_channel(size * 2); let blue = read_channel(size * 4); -- cgit v1.2.3