diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-12-15 14:49:08 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-20 07:05:04 -0800 |
commit | 070c0176049744f63c7f553edcd74ba2376f3ec9 (patch) | |
tree | 790741eb1f9749f1b152dd5c8de8d1f45c42d00c | |
parent | e831466614f7657d3ae20976d5f137f2b6fb0db6 (diff) | |
download | nix-070c0176049744f63c7f553edcd74ba2376f3ec9.zip |
Use iter::Cloned() instead of closure
-rw-r--r-- | test/sys/test_uio.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index 76597790..262874b3 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -14,7 +14,7 @@ fn test_writev() { for _ in 0..16 { let s: String = thread_rng().gen_ascii_chars().take(128).collect(); let b = s.as_bytes(); - to_write.extend(b.iter().map(|x| x.clone())); + to_write.extend(b.iter().cloned()); } // Allocate and fill iovecs let mut iovecs = Vec::new(); @@ -84,7 +84,7 @@ fn test_readv() { // Cccumulate data from iovecs let mut read_buf = Vec::with_capacity(to_write.len()); for iovec in iovecs.iter() { - read_buf.extend(iovec.as_slice().iter().map(|x| x.clone())); + read_buf.extend(iovec.as_slice().iter().cloned()); } // Check whether iovecs contain all written data assert_eq!(read_buf.len(), to_write.len()); |