Fixed some warnings.

This commit is contained in:
Kirill Kuzminykh
2026-01-03 02:25:46 +03:00
parent 68923d456c
commit 94f417821e
2 changed files with 3 additions and 5 deletions
+2 -2
View File
@@ -91,10 +91,10 @@ where
/// the already yielded items.
///
/// Since the iterator is passed as a mutable reference and this function calls
/// `next` at most `N` times, the iterator can still be used afterwards to
/// `next` at most `N` times, the iterator can still be used afterward to
/// retrieve the remaining items.
///
/// If `iter.next()` panicks, all items already yielded by the iterator are
/// If `iter.next()` panics, all items already yielded by the iterator are
/// dropped.
///
/// Used for [`Iterator::next_chunk`].
+1 -3
View File
@@ -102,9 +102,8 @@ unsafe impl<'a, P: InnerPixel> ImageView for TypedImageRef<'a, P> {
let mut res = Vec::with_capacity(num_parts as usize);
let step = height / num_parts;
let mut modulo = height % num_parts;
let mut top = start_row;
let row_size = self.width as usize;
let mut remains_pixels = self.pixels.split_at(top as usize * row_size).1;
let mut remains_pixels = self.pixels.split_at(start_row as usize * row_size).1;
for _ in 0..num_parts {
let mut part_height = step;
if modulo > 0 {
@@ -115,7 +114,6 @@ unsafe impl<'a, P: InnerPixel> ImageView for TypedImageRef<'a, P> {
let image = TypedImageRef::new(self.width, part_height, parts.0).unwrap();
res.push(image);
remains_pixels = parts.1;
top += part_height;
}
Some(res)
}