Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Commit

Permalink
Use slice::iter instead of into_iter to avoid future breakage
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
LukasKalbertodt authored and pyfisch committed Nov 2, 2019
1 parent e3eb497 commit 5d83e67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod std_tests {
-65537,
-4294967296,
]
.into_iter()
.iter()
.map(|i| Value::Integer(*i))
.collect::<Vec<_>>();

Expand All @@ -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::<Vec<_>>();

Expand Down
2 changes: 1 addition & 1 deletion tests/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mod std_tests {
(format!("key3"), format!("value3")),
(format!("key4"), format!("value4")),
]
.into_iter()
.iter()
.cloned(),
);

Expand Down

0 comments on commit 5d83e67

Please # to comment.