Skip to content

Commit 2a66814

Browse files
committed
Fix fold explanation in the guide
The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.
1 parent d670919 commit 2a66814

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,7 +4365,7 @@ element, `find` returns an `Option` rather than the element itself.
43654365
Another important consumer is `fold`. Here's what it looks like:
43664366

43674367
```{rust}
4368-
let sum = range(1i, 100i)
4368+
let sum = range(1i, 4i)
43694369
.fold(0i, |sum, x| sum + x);
43704370
```
43714371

@@ -4389,7 +4389,7 @@ in this iterator:
43894389
We called `fold()` with these arguments:
43904390

43914391
```{rust}
4392-
# range(1i, 5i)
4392+
# range(1i, 4i)
43934393
.fold(0i, |sum, x| sum + x);
43944394
```
43954395

0 commit comments

Comments
 (0)