Skip to content

Commit

Permalink
Replace all occurrences of 'when' with 'if' in documentation and tuto…
Browse files Browse the repository at this point in the history
…rial.

Also update the naturaldocs keywords file.

Closes #1396
  • Loading branch information
Austin Seipp authored and brson committed Jan 10, 2012
1 parent 070b1c8 commit 55edb4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/keywords.txt
Expand Up @@ -17,4 +17,4 @@ self str syntax
tag true type
u16 u32 u64 u8 uint unchecked unsafe use
vec
when while with
while with
4 changes: 2 additions & 2 deletions doc/rust.texi
Expand Up @@ -3331,12 +3331,12 @@ let message = alt x @{

Finally, alt patterns can accept @emph{pattern guards} to further refine the
criteria for matching a case. Pattern guards appear after the pattern and
consist of a bool-typed expression following the @emph{when} keyword. A pattern
consist of a bool-typed expression following the @emph{if} keyword. A pattern
guard may refer to the variables bound within the pattern they follow.

@example
let message = alt maybe_digit @{
some(x) when x < 10 @{ process_digit(x) @}
some(x) if x < 10 @{ process_digit(x) @}
some(x) @{ process_other(x) @}
@}
@end example
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/control.md
Expand Up @@ -67,7 +67,7 @@ that `(float, float)` is a tuple of two floats:

fn angle(vec: (float, float)) -> float {
alt vec {
(0f, y) when y < 0f { 1.5 * std::math::pi }
(0f, y) if y < 0f { 1.5 * std::math::pi }
(0f, y) { 0.5 * std::math::pi }
(x, y) { std::math::atan(y / x) }
}
Expand Down

0 comments on commit 55edb4a

Please sign in to comment.