Skip to content

tutorial: changing again to loop #3605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ literals and most enum variants.

`while` produces a loop that runs as long as its given condition
(which must have type `bool`) evaluates to true. Inside a loop, the
keyword `break` can be used to abort the loop, and `again` can be used
keyword `break` can be used to abort the loop, and `loop` can be used
to abort the current iteration and continue with the next.

~~~~
Expand Down Expand Up @@ -1564,7 +1564,7 @@ Empty argument lists can be omitted from `do` expressions.

Most iteration in Rust is done with `for` loops. Like `do`,
`for` is a nice syntax for doing control flow with closures.
Additionally, within a `for` loop, `break`, `again`, and `return`
Additionally, within a `for` loop, `break`, `loop`, and `return`
work just as they do with `while` and `loop`.

Consider again our `each` function, this time improved to
Expand Down Expand Up @@ -1599,7 +1599,7 @@ With `for`, functions like `each` can be treated more
like builtin looping structures. When calling `each`
in a `for` loop, instead of returning `false` to break
out of the loop, you just write `break`. To skip ahead
to the next iteration, write `again`.
to the next iteration, write `loop`.

~~~~
# use each = vec::each;
Expand Down