Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Increment self.len in specialized ZipImpl to avoid underflow in size_…
…hint
  • Loading branch information
SkiFire13 committed Mar 3, 2021
commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3
1 change: 1 addition & 0 deletions library/core/src/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down