[doc] clippy

This commit is contained in:
2026-11-17 11:28:29 +01:00
parent 0cba2be2b2
commit bf0bb1db5d
+2 -2
View File
@@ -60,10 +60,10 @@ fn wand_and_delete_take_a_stroke_with_its_soft_edge() {
let mut r = Raster::new(120, 60); let mut r = Raster::new(120, 60);
let b = Brush { radius: 8.0, hardness: 0.3, color: [31, 42, 68, 255], opacity: 1.0, erase: false }; let b = Brush { radius: 8.0, hardness: 0.3, color: [31, 42, 68, 255], opacity: 1.0, erase: false };
bitmap::brush(&mut r, &[(10.0, 30.0, 1.0), (110.0, 30.0, 1.0)], &b, None); bitmap::brush(&mut r, &[(10.0, 30.0, 1.0), (110.0, 30.0, 1.0)], &b, None);
assert!(r.rgba.chunks_exact(4).any(|p| p[3] > 0 && p[3] < 255), "the stroke has a soft edge"); assert!(r.rgba.as_chunks::<4>().0.iter().any(|p| p[3] > 0 && p[3] < 255), "the stroke has a soft edge");
let m = bitmap::region(&r, 60, 30, 24); let m = bitmap::region(&r, 60, 30, 24);
bitmap::clear(&mut r, Some(&m)); bitmap::clear(&mut r, Some(&m));
assert!(r.rgba.chunks_exact(4).all(|p| p[3] == 0), "pixels of the stroke were left behind"); assert!(r.rgba.as_chunks::<4>().0.iter().all(|p| p[3] == 0), "pixels of the stroke were left behind");
} }
#[test] #[test]