We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5b32dd0 + 31b9764 commit 0291b6aCopy full SHA for 0291b6a
src/libcore/iter/traits/iterator.rs
@@ -719,6 +719,8 @@ pub trait Iterator {
719
/// ```
720
///
721
/// of these layers.
722
+ ///
723
+ /// Note that `iter.filter(f).next()` is equivalent to `iter.find(f)`.
724
#[inline]
725
#[stable(feature = "rust1", since = "1.0.0")]
726
fn filter<P>(self, predicate: P) -> Filter<Self, P>
@@ -2152,6 +2154,8 @@ pub trait Iterator {
2152
2154
/// // we can still use `iter`, as there are more elements.
2153
2155
/// assert_eq!(iter.next(), Some(&3));
2156
2157
2158
+ /// Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`.
2159
2160
2161
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
0 commit comments