diff options
| -rw-r--r-- | doc/tutorial.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index 23961235d1a..0674dee4c33 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -2042,8 +2042,9 @@ as in this version of `print_all` that copies elements. fn print_all<T: Printable Copy>(printable_things: ~[T]) { let mut i = 0; while i < printable_things.len() { - let copy_of_thing = printable_things[0]; + let copy_of_thing = printable_things[i]; copy_of_thing.print(); + i += 1; } } ~~~ |
