Skip to content

Commit

Permalink
Auto merge of #28028 - tshepang:add-size_hint-example, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Aug 27, 2015
2 parents f663286 + 0ca1cae commit 40fd4d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ pub trait Iterator {
///
/// An upper bound of `None` means either there is no known upper bound, or
/// the upper bound does not fit within a `usize`.
///
/// # Examples
///
/// ```
/// let it = (0..10).filter(|x| x % 2 == 0).chain(15..20);
/// assert_eq!((5, Some(15)), it.size_hint());
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn size_hint(&self) -> (usize, Option<usize>) { (0, None) }
Expand Down

0 comments on commit 40fd4d6

Please sign in to comment.