about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
diff options
context:
space:
mode:
authorLucas Kent <rubickent@gmail.com>2021-12-17 18:36:18 +1100
committerLucas Kent <rubickent@gmail.com>2022-01-09 14:09:25 +1100
commit08829853d3c69f68a5a09fb4bcc53ca87d373a78 (patch)
tree338b04e9ccd5b0aabb6f128f23704013c3d11508 /compiler/rustc_data_structures
parent23ce5fc4655ed546f74a85fc8836e95bec0c64fd (diff)
downloadrust-08829853d3c69f68a5a09fb4bcc53ca87d373a78.tar.gz
rust-08829853d3c69f68a5a09fb4bcc53ca87d373a78.zip
eplace usages of vec![].into_iter with [].into_iter
Diffstat (limited to 'compiler/rustc_data_structures')
-rw-r--r--compiler/rustc_data_structures/src/thin_vec/tests.rs4
-rw-r--r--compiler/rustc_data_structures/src/vec_map/tests.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/thin_vec/tests.rs b/compiler/rustc_data_structures/src/thin_vec/tests.rs
index 5abfd939373..0221b9912bb 100644
--- a/compiler/rustc_data_structures/src/thin_vec/tests.rs
+++ b/compiler/rustc_data_structures/src/thin_vec/tests.rs
@@ -10,8 +10,8 @@ impl<T> ThinVec<T> {
 fn test_from_iterator() {
     assert_eq!(std::iter::empty().collect::<ThinVec<String>>().into_vec(), Vec::<String>::new());
     assert_eq!(std::iter::once(42).collect::<ThinVec<_>>().into_vec(), vec![42]);
-    assert_eq!(vec![1, 2].into_iter().collect::<ThinVec<_>>().into_vec(), vec![1, 2]);
-    assert_eq!(vec![1, 2, 3].into_iter().collect::<ThinVec<_>>().into_vec(), vec![1, 2, 3]);
+    assert_eq!([1, 2].into_iter().collect::<ThinVec<_>>().into_vec(), vec![1, 2]);
+    assert_eq!([1, 2, 3].into_iter().collect::<ThinVec<_>>().into_vec(), vec![1, 2, 3]);
 }
 
 #[test]
diff --git a/compiler/rustc_data_structures/src/vec_map/tests.rs b/compiler/rustc_data_structures/src/vec_map/tests.rs
index 9083de85982..458b60077dc 100644
--- a/compiler/rustc_data_structures/src/vec_map/tests.rs
+++ b/compiler/rustc_data_structures/src/vec_map/tests.rs
@@ -14,7 +14,7 @@ fn test_from_iterator() {
     );
     assert_eq!(std::iter::once((42, true)).collect::<VecMap<_, _>>().into_vec(), vec![(42, true)]);
     assert_eq!(
-        vec![(1, true), (2, false)].into_iter().collect::<VecMap<_, _>>().into_vec(),
+        [(1, true), (2, false)].into_iter().collect::<VecMap<_, _>>().into_vec(),
         vec![(1, true), (2, false)]
     );
 }
@@ -41,7 +41,7 @@ fn test_insert() {
 
 #[test]
 fn test_get() {
-    let v = vec![(1, true), (2, false)].into_iter().collect::<VecMap<_, _>>();
+    let v = [(1, true), (2, false)].into_iter().collect::<VecMap<_, _>>();
     assert_eq!(v.get(&1), Some(&true));
     assert_eq!(v.get(&2), Some(&false));
     assert_eq!(v.get(&3), None);