mirror of
https://github.com/Cykooz/fast_image_resize.git
synced 2026-10-07 17:01:09 +00:00
Fixed some warnings.
This commit is contained in:
+2
-2
@@ -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`].
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user