about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-07-17 23:39:37 -0400
committerCorey Farwell <coreyf@rwell.org>2018-07-17 23:39:37 -0400
commit2d4011db07f08d5c9f3bf9622955f54321877f7b (patch)
tree687ccae4f078e879cef161e9d16277894ea18132
parentf686885a14fff16ddf984b08fb0d9ded07e66f1c (diff)
downloadrust-2d4011db07f08d5c9f3bf9622955f54321877f7b.tar.gz
rust-2d4011db07f08d5c9f3bf9622955f54321877f7b.zip
Clarify short-circuiting behvaior of Iterator::zip.
Fixes https://github.com/rust-lang/rust/issues/52279.
-rw-r--r--src/libcore/iter/iterator.rs4
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
     ///