diff options
| author | kennytm <kennytm@gmail.com> | 2018-07-18 22:35:04 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-18 22:35:04 +0800 |
| commit | 091c9d2eed007f8de81a3213c983c59934b2c0ec (patch) | |
| tree | 5626ef078489746f5ca0bee93b1e59a00cd03b03 | |
| parent | 5624d2a29218e423a758268e60182906da31c9e8 (diff) | |
| parent | 2d4011db07f08d5c9f3bf9622955f54321877f7b (diff) | |
| download | rust-091c9d2eed007f8de81a3213c983c59934b2c0ec.tar.gz rust-091c9d2eed007f8de81a3213c983c59934b2c0ec.zip | |
Rollup merge of #52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton
Clarify short-circuiting behvaior of Iterator::zip. Fixes https://github.com/rust-lang/rust/issues/52279.
| -rw-r--r-- | src/libcore/iter/iterator.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index c0681619bf8..afc273d265b 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -384,7 +384,9 @@ pub trait Iterator { /// /// In other words, it zips two iterators together, into a single one. /// - /// If either iterator returns [`None`], [`next`] will return [`None`]. + /// If either iterator returns [`None`], [`next`] from the zipped iterator + /// will return [`None`]. If the first iterator returns [`None`], `zip` will + /// short-circuit and `next` will not be called on the second iterator. /// /// # Examples /// |
