summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-15 15:51:43 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commit0d6770baf3901f98a2203051860011beb663ee84 (patch)
treed2aaa15e3ad79b35306211610855c4cb669c2448 /test/sys
parentd203e92ad7e2d17935bc81fdf0082eebe0ab5ebe (diff)
downloadnix-0d6770baf3901f98a2203051860011beb663ee84.zip
Remove uses of .iter()/.iter_mut()
More Rusty to use &X and &mut X where X is a container type.
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_uio.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs
index 8c326a38..c6331f1d 100644
--- a/test/sys/test_uio.rs
+++ b/test/sys/test_uio.rs
@@ -66,7 +66,7 @@ fn test_readv() {
allocated += vec_len;
}
let mut iovecs = Vec::with_capacity(storage.len());
- for v in storage.iter_mut() {
+ for v in &mut storage {
iovecs.push(IoVec::from_mut_slice(&mut v[..]));
}
let pipe_res = pipe();
@@ -83,7 +83,7 @@ fn test_readv() {
assert_eq!(to_write.len(), read);
// Cccumulate data from iovecs
let mut read_buf = Vec::with_capacity(to_write.len());
- for iovec in iovecs.iter() {
+ for iovec in &iovecs {
read_buf.extend(iovec.as_slice().iter().cloned());
}
// Check whether iovecs contain all written data
@@ -231,7 +231,7 @@ fn test_process_vm_readv() {
},
Child => {
let _ = close(r);
- for i in vector.iter_mut() {
+ for i in &mut vector {
*i += 1;
}
let _ = write(w, b"\0");