From 2d4011db07f08d5c9f3bf9622955f54321877f7b Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 17 Jul 2018 23:39:37 -0400 Subject: [PATCH] Clarify short-circuiting behvaior of Iterator::zip. Fixes https://github.com/rust-lang/rust/issues/52279. --- src/libcore/iter/iterator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ///