From 8124cf7b4350719989161efa22a0e7ab07a4c8ab Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 9 Oct 2026 23:15:36 +0700 Subject: [PATCH] Clippy 1.99: as_chunks in the Affinity raster tests #763 landed beside #771 with five chunks_exact(4) calls in crates/affinity/tests/raster.rs, which clippy 1.99's chunks_exact_to_as_chunks rejects, so cargo xtask ci failed at clippy on main. Co-Authored-By: Claude Opus 5.5 --- crates/affinity/tests/raster.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/affinity/tests/raster.rs b/crates/affinity/tests/raster.rs index ed98dc51..e477b4d2 100644 --- a/crates/affinity/tests/raster.rs +++ b/crates/affinity/tests/raster.rs @@ -54,8 +54,8 @@ fn source_backed_tiles_retain_the_embedded_jpeg_pixels() { let Pixels::Rgba8(pixels) = &image.pixels else { panic!("expected retained level-zero pixels") }; let expected = image::load_from_memory(&source(&bytes)).unwrap().into_rgba8(); assert_eq!(pixels.as_slice(), expected.as_raw()); - assert!(pixels.chunks_exact(4).all(|p| p[3] == 255)); - assert!(pixels.chunks_exact(4).any(|p| p[0] != p[1])); + assert!(pixels.as_chunks::<4>().0.iter().all(|p| p[3] == 255)); + assert!(pixels.as_chunks::<4>().0.iter().any(|p| p[0] != p[1])); } #[test] @@ -80,8 +80,8 @@ fn eight_and_sixteen_bit_channels_retain_the_same_pixel_pattern() { let Pixels::Rgba8(pixels) = &images8[0].pixels else { panic!() }; assert_eq!(pixels.len(), 64 * 48 * 4); assert_eq!(&pixels[..4], &[0, 0, 0, 128]); - assert!(pixels.chunks_exact(4).any(|p| p[3] < 255)); - assert!(pixels.chunks_exact(4).any(|p| p[0] != p[1])); + assert!(pixels.as_chunks::<4>().0.iter().any(|p| p[3] < 255)); + assert!(pixels.as_chunks::<4>().0.iter().any(|p| p[0] != p[1])); // Frozen pixel-retention baseline, including every alpha sample. It is not a render oracle. assert_eq!(crc32fast::hash(pixels), 0xc8ee4dc1); } @@ -98,7 +98,7 @@ fn rotated_scaled_pixels_keep_the_full_affine_transform() { } let Pixels::Rgba8(pixels) = &images[0].pixels else { panic!() }; assert_eq!(pixels.len(), 80 * 60 * 4); - assert!(pixels.chunks_exact(4).all(|p| p[3] == 255)); + assert!(pixels.as_chunks::<4>().0.iter().all(|p| p[3] == 255)); assert_eq!(crc32fast::hash(pixels), 0x3720a442); }