PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
fix(oracle): chunks_exact with a constant size trips clippy 1.99
sanchesb57e2f688436
diff --git a/crates/oracle/src/pixels.rs b/crates/oracle/src/pixels.rsindex 7365e37ea..b74d07c06 100644--- a/crates/oracle/src/pixels.rs+++ b/crates/oracle/src/pixels.rs@@ -186,8 +186,8 @@ pub fn decode_pam_gray(bytes: &[u8]) -> Option<(usize, usize, Vec<u8>)> {return None;}let mut out = Vec::with_capacity(width.checked_mul(height)?);- for px in data.get(..wanted)?.chunks_exact(4) {- let (&r, &g, &b, &a) = (px.first()?, px.get(1)?, px.get(2)?, px.get(3)?);+ for px in data.get(..wanted)?.as_chunks::<4>().0 {+ let [r, g, b, a] = *px;// Composite premultiplied RGB over white, in integer arithmetic that cannot overflow:// each term is at most 255, and the sum is at most 255.let over_white = |c: u8| u32::from(c).saturating_add(255u32.saturating_sub(u32::from(a))).min(255);