Skip to content

Commit 1bfe6a2

Browse files
committed
Guide: Iterators: …are always lazy + rewrap as per request
1 parent 56f1a67 commit 1bfe6a2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/doc/guide.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -4416,11 +4416,12 @@ see why consumers matter.
44164416

44174417
## Iterators
44184418

4419-
As we've said before, an iterator is something that we can call the `.next()`
4420-
method on repeatedly, and it gives us a sequence of things. Because you need
4421-
to call the method, this means that iterators can be **lazy** and don't need to generate all of the values upfront. This code, for
4422-
example, does not actually generate the numbers `1-100`, and just creates a
4423-
value that represents the sequence:
4419+
As we've said before, an iterator is something that we can call the
4420+
`.next()` method on repeatedly, and it gives us a sequence of things.
4421+
Because you need to call the method, this means that iterators
4422+
are **lazy** and don't need to generate all of the values upfront.
4423+
This code, for example, does not actually generate the numbers
4424+
`1-100`, and just creates a value that represents the sequence:
44244425

44254426
```{rust}
44264427
let nums = range(1i, 100i);

0 commit comments

Comments
 (0)