diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2015-02-15 05:19:50 +0000 |
|---|---|---|
| committer | Kevin Butler <haqkrs@gmail.com> | 2015-02-18 00:57:35 +0000 |
| commit | 061206b9c75cf89b94dac1a2f358a0c649d796ae (patch) | |
| tree | 338308f061cdddd75b18d6fd003abaa1e58c0a1f /src/libstd | |
| parent | 2f586b9687e5c33d9d3b8eccfc309f65d2a9f4e9 (diff) | |
| download | rust-061206b9c75cf89b94dac1a2f358a0c649d796ae.tar.gz rust-061206b9c75cf89b94dac1a2f358a0c649d796ae.zip | |
Remove usage of .map(|&foo| foo)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/old_path/posix.rs | 4 | ||||
| -rw-r--r-- | src/libstd/old_path/windows.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rand/mod.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs index 6bf2a30b7b1..d5125f03a71 100644 --- a/src/libstd/old_path/posix.rs +++ b/src/libstd/old_path/posix.rs @@ -1172,7 +1172,7 @@ mod tests { let exp: &[&[u8]] = &[$($exp),*]; assert_eq!(comps, exp); let comps = path.components().rev().collect::<Vec<&[u8]>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&[u8]>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<&[u8]>>(); assert_eq!(comps, exp) } ) @@ -1204,7 +1204,7 @@ mod tests { let exp: &[Option<&str>] = &$exp; assert_eq!(comps, exp); let comps = path.str_components().rev().collect::<Vec<Option<&str>>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<Option<&str>>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<Option<&str>>>(); assert_eq!(comps, exp); } ) diff --git a/src/libstd/old_path/windows.rs b/src/libstd/old_path/windows.rs index 54c070e1b7d..e485dae3503 100644 --- a/src/libstd/old_path/windows.rs +++ b/src/libstd/old_path/windows.rs @@ -2226,7 +2226,7 @@ mod tests { assert_eq!(comps, exp); let comps = path.str_components().rev().map(|x|x.unwrap()) .collect::<Vec<&str>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&str>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<&str>>(); assert_eq!(comps, exp); } ); @@ -2282,7 +2282,7 @@ mod tests { let exp: &[&[u8]] = &$exp; assert_eq!(comps, exp); let comps = path.components().rev().collect::<Vec<&[u8]>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&[u8]>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<&[u8]>>(); assert_eq!(comps, exp); } ) diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 8f9e966cbb2..5b888c7612d 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -547,7 +547,7 @@ mod test { #[test] fn test_choose() { let mut r = thread_rng(); - assert_eq!(r.choose(&[1, 1, 1]).map(|&x|x), Some(1)); + assert_eq!(r.choose(&[1, 1, 1]).cloned(), Some(1)); let v: &[int] = &[]; assert_eq!(r.choose(v), None); |
