Mention that find() doesn't consume the full iterator
This commit is contained in:
parent
394269d16e
commit
f85f971e44
1 changed files with 3 additions and 1 deletions
|
|
@ -548,7 +548,9 @@ pub trait Iterator<A> {
|
|||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue