diff options
| author | Muhammad Mominul Huque <mominul2082@gmail.com> | 2021-06-02 16:06:34 +0600 |
|---|---|---|
| committer | Muhammad Mominul Huque <mominul2082@gmail.com> | 2021-06-02 16:09:04 +0600 |
| commit | 507d97b26efc002129e5ba084f4361d7fde636ff (patch) | |
| tree | dba7146c16d7c79ed80166cf3277b4bba1367cbf /library/alloc/tests | |
| parent | 01d4d46f66929122cc890279cde4765df7a0a90f (diff) | |
| download | rust-507d97b26efc002129e5ba084f4361d7fde636ff.tar.gz rust-507d97b26efc002129e5ba084f4361d7fde636ff.zip | |
Update expressions where we can use array's IntoIterator implementation
Diffstat (limited to 'library/alloc/tests')
| -rw-r--r-- | library/alloc/tests/vec.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs index 36c81b49709..c203cdafecb 100644 --- a/library/alloc/tests/vec.rs +++ b/library/alloc/tests/vec.rs @@ -793,7 +793,7 @@ fn test_drain_leak() { fn test_splice() { let mut v = vec![1, 2, 3, 4, 5]; let a = [10, 11, 12]; - v.splice(2..4, a.iter().cloned()); + v.splice(2..4, a); assert_eq!(v, &[1, 2, 10, 11, 12, 5]); v.splice(1..3, Some(20)); assert_eq!(v, &[1, 20, 11, 12, 5]); @@ -803,7 +803,7 @@ fn test_splice() { fn test_splice_inclusive_range() { let mut v = vec![1, 2, 3, 4, 5]; let a = [10, 11, 12]; - let t1: Vec<_> = v.splice(2..=3, a.iter().cloned()).collect(); + let t1: Vec<_> = v.splice(2..=3, a).collect(); assert_eq!(v, &[1, 2, 10, 11, 12, 5]); assert_eq!(t1, &[3, 4]); let t2: Vec<_> = v.splice(1..=2, Some(20)).collect(); @@ -816,7 +816,7 @@ fn test_splice_inclusive_range() { fn test_splice_out_of_bounds() { let mut v = vec![1, 2, 3, 4, 5]; let a = [10, 11, 12]; - v.splice(5..6, a.iter().cloned()); + v.splice(5..6, a); } #[test] @@ -824,7 +824,7 @@ fn test_splice_out_of_bounds() { fn test_splice_inclusive_out_of_bounds() { let mut v = vec![1, 2, 3, 4, 5]; let a = [10, 11, 12]; - v.splice(5..=5, a.iter().cloned()); + v.splice(5..=5, a); } #[test] @@ -848,7 +848,7 @@ fn test_splice_unbounded() { fn test_splice_forget() { let mut v = vec![1, 2, 3, 4, 5]; let a = [10, 11, 12]; - std::mem::forget(v.splice(2..4, a.iter().cloned())); + std::mem::forget(v.splice(2..4, a)); assert_eq!(v, &[1, 2]); } |
