Update README.md

pull/124/head
Dhghomon 3 years ago committed by GitHub
parent 1980638e43
commit f81679270a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5635,7 +5635,7 @@ An iterator is a construct that can give you the items in the collection, one at
- `.iter_mut()` for an iterator of mutable references
- `.into_iter()` for an iterator of values (not references)
A `for` loop is actually just an iterator that uses `.iter_mut()`. That's why you can change the values when you use it.
A `for` loop is actually just an iterator that owns its values. That's why it can make it mutable and then you can change the values when you use it.
We can use iterators like this:

Loading…
Cancel
Save