mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-30 04:37:29 -06:00
Symbols: the thumbnail test reads pixels as four-byte chunks, as clippy asks
This commit is contained in:
committed by
bflatastic
parent
ee5c262154
commit
f6715487c0
@@ -422,8 +422,7 @@ mod tests {
|
||||
|
||||
/// Pixels of `img` that something paints opaquely, and those of them that are red.
|
||||
fn painted(img: &vectorcraft_render::Rendered) -> (usize, usize) {
|
||||
let px = img.pixels.chunks_exact(4);
|
||||
let painted: Vec<&[u8]> = px.filter(|p| p[3] > 200).collect();
|
||||
let painted: Vec<&[u8; 4]> = img.pixels.as_chunks::<4>().0.iter().filter(|p| p[3] > 200).collect();
|
||||
let red = painted.iter().filter(|p| p[0] > 150 && p[1] < 80 && p[2] < 80).count();
|
||||
(painted.len(), red)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user