diff options
| author | Piotr Szotkowski <chastell@chastell.net> | 2014-10-28 20:23:59 +0100 |
|---|---|---|
| committer | Piotr Szotkowski <chastell@chastell.net> | 2014-10-28 20:24:02 +0100 |
| commit | 1bfe6a2a54e47679b4aed2a745dbd70bb393121a (patch) | |
| tree | 5143d0dc5212af96e6237ade62a1e88919947eab | |
| parent | 56f1a67cc7b95215274580c758ce56727a5bdc40 (diff) | |
| download | rust-1bfe6a2a54e47679b4aed2a745dbd70bb393121a.tar.gz rust-1bfe6a2a54e47679b4aed2a745dbd70bb393121a.zip | |
Guide: Iterators: …are always lazy + rewrap as per request
| -rw-r--r-- | src/doc/guide.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 34ec7e4eee9..a1cb07092b2 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -4416,11 +4416,12 @@ see why consumers matter. ## Iterators -As we've said before, an iterator is something that we can call the `.next()` -method on repeatedly, and it gives us a sequence of things. Because you need -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 -example, does not actually generate the numbers `1-100`, and just creates a -value that represents the sequence: +As we've said before, an iterator is something that we can call the +`.next()` method on repeatedly, and it gives us a sequence of things. +Because you need to call the method, this means that iterators +are **lazy** and don't need to generate all of the values upfront. +This code, for example, does not actually generate the numbers +`1-100`, and just creates a value that represents the sequence: ```{rust} let nums = range(1i, 100i); |
