about summary refs log tree commit diff
path: root/src/librustc/util
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/librustc/util
parent5705d48e280f8a0065c214edfb3dcdcecc323316 (diff)
downloadrust-2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9.tar.gz
rust-2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9.zip
Opt for .cloned() over .map(|x| x.clone()) etc.
Diffstat (limited to 'src/librustc/util')
-rw-r--r--src/librustc/util/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs
index d3d0f56c3ce..a6d8bc24da7 100644
--- a/src/librustc/util/common.rs
+++ b/src/librustc/util/common.rs
@@ -214,7 +214,7 @@ pub fn memoized<T, U, S, F>(cache: &RefCell<HashMap<T, U, S>>, arg: T, f: F) ->
           F: FnOnce(T) -> U,
 {
     let key = arg.clone();
-    let result = cache.borrow().get(&key).map(|result| result.clone());
+    let result = cache.borrow().get(&key).cloned();
     match result {
         Some(result) => result,
         None => {