1
Fork 0

Increment self.len in specialized ZipImpl to avoid underflow in size_hint

This commit is contained in:
Giacomo Stevanato 2021-02-19 12:15:37 +01:00
parent 939b14334d
commit 66a260617a

View file

@ -200,6 +200,7 @@ where
} else if A::MAY_HAVE_SIDE_EFFECT && self.index < self.a.size() {
let i = self.index;
self.index += 1;
self.len += 1;
// match the base implementation's potential side effects
// SAFETY: we just checked that `i` < `self.a.len()`
unsafe {