Skip to content

Commit 8763ecc

Browse files
Attempt to permanently fix ZST drain_iter issue that seems to have popped up again
1 parent d1b9319 commit 8763ecc

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
@@ -117,10 +117,10 @@ impl<'a, T: 'a, const N: usize> Iterator for StaticVecIterConst<'a, T, N> {
117117
0 => None,
118118
_ => {
119119
let res = Some(&*self.start);
120-
self.start = match size_of::<T>() {
121-
0 => (self.start as usize + 1) as *const T,
122-
_ => self.start.offset(1),
123-
};
120+
match size_of::<T>() {
121+
0 => self.end = (self.end as *const u8).wrapping_offset(-1) as *const T;
122+
_ => self.start = self.start.offset(1),
123+
}
124124
res
125125
}
126126
}

0 commit comments

Comments
 (0)