mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
clippy: as_chunks for fixed-size pixel and pair chunks (Rust 1.99 lint was red on main)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed by
bflatastic
co-authored by
Claude Opus 5.5
parent
c4236e1bb2
commit
0f241aac9f
@@ -33,7 +33,7 @@ impl Image {
|
||||
}
|
||||
/// Number of pixels for which `pred(rgba)` holds.
|
||||
pub fn count(&self, pred: impl Fn([u8; 4]) -> bool) -> usize {
|
||||
self.rgba.chunks_exact(4).filter(|p| pred([p[0], p[1], p[2], p[3]])).count()
|
||||
self.rgba.as_chunks::<4>().0.iter().filter(|p| pred([p[0], p[1], p[2], p[3]])).count()
|
||||
}
|
||||
/// Pixels that differ from opaque white and are not fully transparent.
|
||||
pub fn ink(&self) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user