1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-28 21:27:37 +02:00

Update for-loops.md to remove misleading sentence (#1094)

Drops the comment about usage in the other loop. It's not related to the
focus on copy semantics, and so we want to eliminate that possible
confusion.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
This commit is contained in:
Danny Yoo 2023-08-23 07:10:24 -07:00 committed by GitHub
parent b98d09f3d7
commit 40b9a1fc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,9 +85,8 @@ preview of issues of ownership that will come later in the afternoon.
Without the `&`...
* The loop would have been one that consumes the array. This is a
change [introduced in the 2021
Edition](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html), and ...
* since the array is also accessed in the second loop, an implicit
array copy would have occured; since `i32` is a copy type, then
Edition](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html).
* An implicit array copy would have occured. Since `i32` is a copy type, then
`[i32; 3]` is also a copy type.
</details>