Skip to content

Commit f85f971

Browse files
committed
Mention that find() doesn't consume the full iterator
1 parent 394269d commit f85f971

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcore/iter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ pub trait Iterator<A> {
548548
false
549549
}
550550

551-
/// Return the first element satisfying the specified predicate
551+
/// Returns the first element satisfying the specified predicate.
552+
///
553+
/// Does not consume the iterator past the first found element.
552554
#[inline]
553555
fn find(&mut self, predicate: |&A| -> bool) -> Option<A> {
554556
for x in *self {

0 commit comments

Comments
 (0)