about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorKevin Butler <haqkrs@gmail.com>2015-02-13 07:33:44 +0000
committerKevin Butler <haqkrs@gmail.com>2015-02-18 00:56:07 +0000
commit2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9 (patch)
tree578e2d49b5c8b71d7c38142adcf6d10dba09d690 /src/libcore
parent5705d48e280f8a0065c214edfb3dcdcecc323316 (diff)
downloadrust-2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9.tar.gz
rust-2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9.zip
Opt for .cloned() over .map(|x| x.clone()) etc.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 299864e3b3d..c5e0966720f 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -350,7 +350,7 @@ pub trait IteratorExt: Iterator + Sized {
     ///
     /// ```
     /// let xs = [100, 200, 300];
-    /// let mut it = xs.iter().map(|x| *x).peekable();
+    /// let mut it = xs.iter().cloned().peekable();
     /// assert_eq!(*it.peek().unwrap(), 100);
     /// assert_eq!(it.next().unwrap(), 100);
     /// assert_eq!(it.next().unwrap(), 200);