From f85f971e4482a5f38d8b702ae9a93065e18446ef Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 20 Nov 2014 23:35:46 +0530 Subject: [PATCH] Mention that find() doesn't consume the full iterator --- src/libcore/iter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 3b62c8da1ebe1..02242492e34a1 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -548,7 +548,9 @@ pub trait Iterator { false } - /// Return the first element satisfying the specified predicate + /// Returns the first element satisfying the specified predicate. + /// + /// Does not consume the iterator past the first found element. #[inline] fn find(&mut self, predicate: |&A| -> bool) -> Option { for x in *self {