File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,13 @@ fn main() {
49
49
## for and iterators
50
50
51
51
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.
60
59
61
60
* ` iter ` - This borrows each element of the collection through each iteration.
62
61
Thus leaving the collection untouched and available for reuse after the loop.
You can’t perform that action at this time.
0 commit comments