Skip to content

Commit 6952431

Browse files
More correctly state what happens when iterating over Rust array types
As of Rust 1.48, array types do not actually implement IntoIterator, which means that the borrow checker automatically introduces borrows with surprising results. This behavior is now explicitly marked as unstable: warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added. warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: for more information, see issue #66145 <rust-lang/rust#66145> This commit changes the into_iter() calls into iter() calls that match the current behavior in Rust.
1 parent cf15096 commit 6952431

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/save/puzzles/noreturn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Tomlable for NoReturnState {
163163
let value = cmp::min(value, order.len() - 1);
164164
order[index] = value;
165165
}
166-
for (index, value) in order.clone().into_iter().enumerate() {
166+
for (index, value) in order.clone().iter().enumerate() {
167167
if order[..index].contains(value) {
168168
order = INITIAL_ORDER;
169169
break;

src/save/puzzles/order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl Tomlable for OrderState {
158158
let value = cmp::min(cmp::max(0, value) as usize, order.len() - 1);
159159
order[index] = value;
160160
}
161-
for (index, value) in order.clone().into_iter().enumerate() {
161+
for (index, value) in order.clone().iter().enumerate() {
162162
if order[..index].contains(value) {
163163
order = *INITIAL_ORDER;
164164
break;

0 commit comments

Comments
 (0)