From 5d83e67ed9f49b7a10b2d6868b0e4bf688ba9d8e Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Wed, 30 Oct 2019 15:18:06 +0100 Subject: [PATCH] Use `slice::iter` instead of `into_iter` to avoid future breakage `an_array.into_iter()` currently just works because of the autoref feature, which then calls `<[T] as IntoIterator>::into_iter`. But in the future, arrays will implement `IntoIterator`, too. In order to avoid problems in the future, the call is replaced by `iter()` which is shorter and more explicit. --- tests/canonical.rs | 4 ++-- tests/value.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/canonical.rs b/tests/canonical.rs index 578aa023..438e29e7 100644 --- a/tests/canonical.rs +++ b/tests/canonical.rs @@ -22,7 +22,7 @@ mod std_tests { -65537, -4294967296, ] - .into_iter() + .iter() .map(|i| Value::Integer(*i)) .collect::>(); @@ -35,7 +35,7 @@ mod std_tests { #[test] fn string_canonical_sort_order() { let expected = ["", "a", "b", "aa"] - .into_iter() + .iter() .map(|s| Value::Text(s.to_string())) .collect::>(); diff --git a/tests/value.rs b/tests/value.rs index 404a7ea7..554d7426 100644 --- a/tests/value.rs +++ b/tests/value.rs @@ -39,7 +39,7 @@ mod std_tests { (format!("key3"), format!("value3")), (format!("key4"), format!("value4")), ] - .into_iter() + .iter() .cloned(), );