Skip to content

Commit 4425422

Browse files
committed
Fix off by one in the iterator documentation
`(1..100).map(|x| x + 1)` is actually mapping [1,100) to [2,101)
1 parent 243e85f commit 4425422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/trpl/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ a new iterator. The simplest one is called `map`:
259259

260260
`map` is called upon another iterator, and produces a new iterator where each
261261
element reference has the closure it's been given as an argument called on it.
262-
So this would give us the numbers from `2-100`. Well, almost! If you
262+
So this would give us the numbers from `2-101`. Well, almost! If you
263263
compile the example, you'll get a warning:
264264

265265
```text

0 commit comments

Comments
 (0)