diff --git a/crates/ec-dnxhd/src/decoder.rs b/crates/ec-dnxhd/src/decoder.rs index 2979819e..85d70de2 100644 --- a/crates/ec-dnxhd/src/decoder.rs +++ b/crates/ec-dnxhd/src/decoder.rs @@ -575,7 +575,7 @@ pub(crate) fn to_picture(c: Canvas) -> Picture { if c.bps == 1 { out.extend(row.iter().map(|&v| u16::from(v))); } else { - out.extend(row.chunks_exact(2).map(|b| u16::from_le_bytes([b[0], b[1]]))); + out.extend(row.as_chunks::<2>().0.iter().map(|b| u16::from_le_bytes(*b))); } } out @@ -596,7 +596,7 @@ pub(crate) fn to_video_frame(mut c: Canvas) -> Result { }; if info.bit_depth == 12 { for p in &mut c.planes { - for b in p.chunks_exact_mut(2) { + for b in p.as_chunks_mut::<2>().0 { let v = (u32::from(u16::from_le_bytes([b[0], b[1]])) + 2) >> 2; b.copy_from_slice(&(v.min(1023) as u16).to_le_bytes()); } diff --git a/crates/ec-dnxhd/src/idct.rs b/crates/ec-dnxhd/src/idct.rs index 61dad64f..c019a61e 100644 --- a/crates/ec-dnxhd/src/idct.rs +++ b/crates/ec-dnxhd/src/idct.rs @@ -155,7 +155,7 @@ pub(crate) fn idct_put(blk: &mut Block, dst: &mut [u8], stride: u } } else { for (row, o) in dst.chunks_mut(stride).zip(out.iter()) { - for (d, &v) in row[..16].chunks_exact_mut(2).zip(o) { + for (d, &v) in row[..16].as_chunks_mut::<2>().0.iter_mut().zip(o) { d.copy_from_slice(&v.to_le_bytes()); } } diff --git a/crates/ec-dnxhd/src/lib.rs b/crates/ec-dnxhd/src/lib.rs index 691c663f..e86cc612 100644 --- a/crates/ec-dnxhd/src/lib.rs +++ b/crates/ec-dnxhd/src/lib.rs @@ -12,7 +12,6 @@ //! ec-core has no 12-bit pixel formats, so [`DnxhdDecoder::decode`] narrows //! 12-bit pictures to 10 bits (`(v + 2) >> 2`, clamped); [`DnxhdDecoder::decode_native`] //! returns the samples at their coded depth. -#![allow(clippy::chunks_exact_to_as_chunks, clippy::needless_range_loop)] #![forbid(unsafe_code)] mod bits; mod codec;