Skip to content

Commit a9a2a31

Browse files
committed
fix docs
1 parent 9b429fd commit a9a2a31

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libcore/iter/traits/iterator.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,9 @@ pub trait Iterator {
20152015
/// Find the maximum value:
20162016
///
20172017
/// ```
2018+
/// #![feature(iterator_fold_self)]
2019+
/// use std::cmp::Ordering;
2020+
///
20182021
/// fn find_max<I>(iter: I) -> Option<I::Item>
20192022
/// where I: Iterator,
20202023
/// I::Item: Ord,
@@ -2027,9 +2030,9 @@ pub trait Iterator {
20272030
/// })
20282031
/// }
20292032
/// let a = [10, 20, 5, -23, 0];
2030-
/// let b = [];
2033+
/// let b: [u32; 0] = [];
20312034
///
2032-
/// assert_eq!(find_max(a.iter()), Some(20));
2035+
/// assert_eq!(find_max(a.iter()), Some(&20));
20332036
/// assert_eq!(find_max(b.iter()), None);
20342037
/// ```
20352038
#[inline]

0 commit comments

Comments
 (0)