From 9f290b56695a24970552e61c19a629196a7d1d2f Mon Sep 17 00:00:00 2001 From: Damien Grassart Date: Mon, 26 Nov 2012 19:28:17 +0100 Subject: [PATCH] Fix sample code in the tutorial --- doc/tutorial.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(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; } } ~~~