mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Mention that find() doesn't consume the full iterator
This commit is contained in:
+3
-1
@@ -548,7 +548,9 @@ fn any(&mut self, f: |A| -> bool) -> bool {
|
||||
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<A> {
|
||||
for x in *self {
|
||||
|
||||
Reference in New Issue
Block a user