mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 00:24:52 +00:00
Auto merge of #25927 - stevegury:patch-1, r=steveklabnik
`(1..100).map(|x| x + 1)` is actually mapping [1,100) to [2,101)
This commit is contained in:
commit
60926b8c59
|
@ -213,7 +213,7 @@ 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 not generate all of the values upfront. This code,
|
||||
for example, does not actually generate the numbers `1-100`, instead
|
||||
for example, does not actually generate the numbers `1-99`, instead
|
||||
creating a value that merely represents the sequence:
|
||||
|
||||
```rust
|
||||
|
|
Loading…
Reference in a new issue