Rollup merge of #69501 - matthiaskrgr:find_note, r=ecstatic-morse

note that find(f) is equivalent to filter(f).next() in the docs.

r? @ecstatic-morse
This commit is contained in:
Dylan DPC 2020-02-28 01:55:46 +01:00 committed by GitHub
commit 0291b6a289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>
@ -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>