Skip to content

Commit

Permalink
Rollup merge of #69501 - matthiaskrgr:find_note, r=ecstatic-morse
Browse files Browse the repository at this point in the history
note that find(f) is equivalent to filter(f).next() in the docs.

r? @ecstatic-morse
  • Loading branch information
Dylan-DPC committed Feb 28, 2020
2 parents 5b32dd0 + 31b9764 commit 0291b6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcore/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ pub trait Iterator {
/// ```
///
/// of these layers.
///
/// Note that `iter.filter(f).next()` is equivalent to `iter.find(f)`.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn filter<P>(self, predicate: P) -> Filter<Self, P>
Expand Down Expand Up @@ -2152,6 +2154,8 @@ pub trait Iterator {
/// // we can still use `iter`, as there are more elements.
/// assert_eq!(iter.next(), Some(&3));
/// ```
///
/// Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Expand Down

0 comments on commit 0291b6a

Please sign in to comment.