about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/iter/traits/iterator.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs
index 853059f98a6..62492f639e4 100644
--- a/src/libcore/iter/traits/iterator.rs
+++ b/src/libcore/iter/traits/iterator.rs
@@ -2023,10 +2023,7 @@ pub trait Iterator {
     ///           I::Item: Ord,
     /// {
     ///     iter.fold_first(|a, b| {
-    ///         a.partial_cmp(b).map(move |cmp| match cmp {
-    ///             Ordering::Greater | Ordering::Equal => a,
-    ///             Ordering::Less => b,
-    ///         })
+    ///         if a >= b { a } else { b }
     ///     })
     /// }
     /// let a = [10, 20, 5, -23, 0];