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:
parent
b98d09f3d7
commit
40b9a1fc2c
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user