We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f663286 + 0ca1cae commit 40fd4d6Copy full SHA for 40fd4d6
src/libcore/iter.rs
@@ -98,6 +98,13 @@ pub trait Iterator {
98
///
99
/// An upper bound of `None` means either there is no known upper bound, or
100
/// the upper bound does not fit within a `usize`.
101
+ ///
102
+ /// # Examples
103
104
+ /// ```
105
+ /// let it = (0..10).filter(|x| x % 2 == 0).chain(15..20);
106
+ /// assert_eq!((5, Some(15)), it.size_hint());
107
108
#[inline]
109
#[stable(feature = "rust1", since = "1.0.0")]
110
fn size_hint(&self) -> (usize, Option<usize>) { (0, None) }
0 commit comments