diff --git a/src/lib.rs b/src/lib.rs index 74f4ef4..e6b060f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -438,7 +438,7 @@ impl Image { T: AsRef<[U]>, { // SAFETY: 0 sized images illegal - unsafe { assert_unchecked(self.len() > CHANNELS) }; + unsafe { assert_unchecked(self.len() >= CHANNELS) }; // SAFETY: no half pixels! unsafe { assert_unchecked(self.len() % CHANNELS == 0) }; self.buffer().as_ref().array_chunks::() @@ -529,7 +529,7 @@ impl + AsRef<[u8]>, const CHANNELS: usize> Image { /// Returns a iterator over every pixel, mutably pub fn chunked_mut(&mut self) -> impl Iterator { // SAFETY: 0 sized images are not allowed - unsafe { assert_unchecked(self.len() > CHANNELS) }; + unsafe { assert_unchecked(self.len() >= CHANNELS) }; // SAFETY: buffer cannot have half pixels unsafe { assert_unchecked(self.len() % CHANNELS == 0) }; self.buffer.as_mut().array_chunks_mut::()