]> git.proxmox.com Git - rustc.git/blobdiff - vendor/itertools/tests/zip.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / vendor / itertools / tests / zip.rs
index 5801b4232ba99ad0587acdf9d78859b50369f5a3..75157d34f3aae32c95c9482189a69efa3514445d 100644 (file)
@@ -29,8 +29,8 @@ fn test_zip_longest_size_hint() {
 fn test_double_ended_zip_longest() {
     let xs = [1, 2, 3, 4, 5, 6];
     let ys = [1, 2, 3, 7];
-    let a = xs.iter().map(|&x| x);
-    let b = ys.iter().map(|&x| x);
+    let a = xs.iter().copied();
+    let b = ys.iter().copied();
     let mut it = a.zip_longest(b);
     assert_eq!(it.next(), Some(Both(1, 1)));
     assert_eq!(it.next(), Some(Both(2, 2)));
@@ -45,8 +45,8 @@ fn test_double_ended_zip_longest() {
 fn test_double_ended_zip() {
     let xs = [1, 2, 3, 4, 5, 6];
     let ys = [1, 2, 3, 7];
-    let a = xs.iter().map(|&x| x);
-    let b = ys.iter().map(|&x| x);
+    let a = xs.iter().copied();
+    let b = ys.iter().copied();
     let mut it = multizip((a, b));
     assert_eq!(it.next_back(), Some((4, 7)));
     assert_eq!(it.next_back(), Some((3, 3)));