mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-01 07:09:35 +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 `&`...
|
Without the `&`...
|
||||||
* The loop would have been one that consumes the array. This is a
|
* The loop would have been one that consumes the array. This is a
|
||||||
change [introduced in the 2021
|
change [introduced in the 2021
|
||||||
Edition](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html), and ...
|
Edition](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html).
|
||||||
* since the array is also accessed in the second loop, an implicit
|
* An implicit array copy would have occured. Since `i32` is a copy type, then
|
||||||
array copy would have occured; since `i32` is a copy type, then
|
|
||||||
`[i32; 3]` is also a copy type.
|
`[i32; 3]` is also a copy type.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user