Skip to content

Commit d370e77

Browse files
author
Matthew Healy
committed
Tighten grammar of 'for and iterators' section
1 parent 1c2bd02 commit d370e77

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/flow_control/for.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ fn main() {
4949
## for and iterators
5050

5151
The `for in` construct is able to interact with an `Iterator` in several ways.
52-
As discussed in with the [Iterator][iter] trait, if not specified, the `for`
53-
loop will apply the `into_iter` function on the collection provided to convert
54-
the collection into an iterator. This is not the only means to convert a
55-
collection into an iterator however, the other functions available include
56-
`iter` and `iter_mut`.
57-
58-
These 3 functions will return different views of the data within your
59-
collection.
52+
As discussed in the section on the [Iterator][iter] trait, by default the `for`
53+
loop will apply the `into_iter` function to the collection. However, this is
54+
not the only means of converting collections into iterators.
55+
56+
`into_iter`, `iter` and `iter_mut` all handle the conversion of a collection
57+
into an iterator in different ways, by providing different views on the data
58+
within.
6059

6160
* `iter` - This borrows each element of the collection through each iteration.
6261
Thus leaving the collection untouched and available for reuse after the loop.

0 commit comments

Comments
 (0)