diff options
| author | Damien Grassart <damien@grassart.com> | 2012-11-26 19:28:17 +0100 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-11-26 14:41:29 -0800 |
| commit | 9f290b56695a24970552e61c19a629196a7d1d2f (patch) | |
| tree | 592172bed209bb227db3d359c5d80a2cb7ce7d79 | |
| parent | 689f6ce5d06439ad39ee6f82774689e399f23422 (diff) | |
| download | rust-9f290b56695a24970552e61c19a629196a7d1d2f.tar.gz rust-9f290b56695a24970552e61c19a629196a7d1d2f.zip | |
Fix sample code in the tutorial
| -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; } } ~~~ |
