about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJelte Fennema <github-tech@jeltef.nl>2014-10-18 19:29:53 +0200
committerJelte Fennema <github-tech@jeltef.nl>2014-10-18 19:29:53 +0200
commit2a668149c26744e906018f13c33a315a1ba79bbd (patch)
treeefda784e62c70ebd4e88177f25a60d443a80d0a9
parentd670919aa43d186317a89a375f4a5b7170fc08a8 (diff)
downloadrust-2a668149c26744e906018f13c33a315a1ba79bbd.tar.gz
rust-2a668149c26744e906018f13c33a315a1ba79bbd.zip
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.
-rw-r--r--src/doc/guide.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md
index db97fc06444..6b9c9b1f683 100644
--- a/src/doc/guide.md
+++ b/src/doc/guide.md
@@ -4365,7 +4365,7 @@ element, `find` returns an `Option` rather than the element itself.
 Another important consumer is `fold`. Here's what it looks like:
 
 ```{rust}
-let sum = range(1i, 100i)
+let sum = range(1i, 4i)
               .fold(0i, |sum, x| sum + x);
 ```
 
@@ -4389,7 +4389,7 @@ in this iterator:
 We called `fold()` with these arguments:
 
 ```{rust}
-# range(1i, 5i)
+# range(1i, 4i)
 .fold(0i, |sum, x| sum + x);
 ```