Skip to content

Commit 091c9d2

Browse files
authored
Rollup merge of rust-lang#52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton
Clarify short-circuiting behvaior of Iterator::zip. Fixes rust-lang#52279.
2 parents 5624d2a + 2d4011d commit 091c9d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcore/iter/iterator.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ pub trait Iterator {
384384
///
385385
/// In other words, it zips two iterators together, into a single one.
386386
///
387-
/// If either iterator returns [`None`], [`next`] will return [`None`].
387+
/// If either iterator returns [`None`], [`next`] from the zipped iterator
388+
/// will return [`None`]. If the first iterator returns [`None`], `zip` will
389+
/// short-circuit and `next` will not be called on the second iterator.
388390
///
389391
/// # Examples
390392
///

0 commit comments

Comments
 (0)