Skip to content

Commit 9c65d12

Browse files
Do previous change for StaticVecIterMut also
1 parent 8763ecc commit 9c65d12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/iterators.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ impl<'a, T: 'a, const N: usize> Iterator for StaticVecIterMut<'a, T, N> {
312312
0 => None,
313313
_ => {
314314
let res = Some(&mut *self.start);
315-
self.start = match size_of::<T>() {
316-
0 => (self.start as usize + 1) as *mut T,
317-
_ => self.start.offset(1),
318-
};
315+
match size_of::<T>() {
316+
0 => self.end = (self.end as *mut u8).wrapping_offset(-1) as *mut T;
317+
_ => self.start = self.start.offset(1),
318+
}
319319
res
320320
}
321321
}

0 commit comments

Comments
 (0)