Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan-DPC committed Mar 26, 2020
1 parent 9b429fd commit a9a2a31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libcore/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,9 @@ pub trait Iterator {
/// Find the maximum value:
///
/// ```
/// #![feature(iterator_fold_self)]
/// use std::cmp::Ordering;
///
/// fn find_max<I>(iter: I) -> Option<I::Item>
/// where I: Iterator,
/// I::Item: Ord,
Expand All @@ -2027,9 +2030,9 @@ pub trait Iterator {
/// })
/// }
/// let a = [10, 20, 5, -23, 0];
/// let b = [];
/// let b: [u32; 0] = [];
///
/// assert_eq!(find_max(a.iter()), Some(20));
/// assert_eq!(find_max(a.iter()), Some(&20));
/// assert_eq!(find_max(b.iter()), None);
/// ```
#[inline]
Expand Down

0 comments on commit a9a2a31

Please sign in to comment.