diff options
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 05f5c755081..51218e473a7 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2976,10 +2976,8 @@ function argument, and we then 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); } } |
