1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-05 16:10:31 +02:00

Update for-expressions.md (#359)

* Update for-expressions.md

* Update for-expressions.md

* Update for-expressions.md

* Fix formatting.

---------

Co-authored-by: Andrew Walbran <qwandor@google.com>
This commit is contained in:
Charisee Chiw 2023-02-09 13:17:15 -08:00 committed by GitHub
parent 65340c4ca1
commit 6a1282c166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,5 +24,6 @@ You can use `break` and `continue` here as usual.
* Index iteration is not a special syntax in Rust for just that case.
* `(0..10)` is a range that implements an `Iterator` trait.
* `step_by` is a method that returns another `Iterator` that skips every other element.
* Modify the elements in the vector and explain the compiler errors. Change vector `v` to be mutable and the for loop to `for x in v.iter_mut()`.
</details>