about summary refs log tree commit diff
diff options
context:
space:
mode:
authordylan_DPC <dylan.dpc@gmail.com>2020-03-26 23:18:37 +0100
committerdylan_DPC <dylan.dpc@gmail.com>2020-03-26 23:18:37 +0100
commita9a2a319afbeb7e2a54f343a9360bd9bc4863b4f (patch)
treeef6f3d595da1a0e23f30c83beb35712d54842fc4
parent9b429fd1219bfd15ec3fd9ce3cb073cdae6ed03c (diff)
downloadrust-a9a2a319afbeb7e2a54f343a9360bd9bc4863b4f.tar.gz
rust-a9a2a319afbeb7e2a54f343a9360bd9bc4863b4f.zip
fix docs
-rw-r--r--src/libcore/iter/traits/iterator.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs
index c066d535f24..853059f98a6 100644
--- a/src/libcore/iter/traits/iterator.rs
+++ b/src/libcore/iter/traits/iterator.rs
@@ -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,
@@ -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]