about summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index a3e13acccae..bdd1e98fd6c 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -2970,10 +2970,8 @@ function argument, and call it with a lambda expression as an argument:
 
 ```
 fn ten_times<F>(f: F) where F: Fn(i32) {
-    let mut i = 0i32;
-    while i < 10 {
-        f(i);
-        i += 1;
+    for index in 0..10 {
+        f(index);
     }
 }