Skip to content

Commit c121cba

Browse files
committed
auto merge of #18139 : JelteF/rust-1/patch-1, r=steveklabnik
The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.
2 parents 18062c1 + 2a66814 commit c121cba

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
@@ -4363,7 +4363,7 @@ element, `find` returns an `Option` rather than the element itself.
43634363
Another important consumer is `fold`. Here's what it looks like:
43644364

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

@@ -4387,7 +4387,7 @@ in this iterator:
43874387
We called `fold()` with these arguments:
43884388

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

0 commit comments

Comments
 (0)