From 55edb4a04f63214d90853fcd4137fc53efe4ec27 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 9 Jan 2012 19:32:54 -0600 Subject: [PATCH] Replace all occurrences of 'when' with 'if' in documentation and tutorial. Also update the naturaldocs keywords file. Closes #1396 --- doc/keywords.txt | 2 +- doc/rust.texi | 4 ++-- doc/tutorial/control.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/keywords.txt b/doc/keywords.txt index eb559f0d5f9f1..de138eb2a105b 100644 --- a/doc/keywords.txt +++ b/doc/keywords.txt @@ -17,4 +17,4 @@ self str syntax tag true type u16 u32 u64 u8 uint unchecked unsafe use vec -when while with +while with diff --git a/doc/rust.texi b/doc/rust.texi index 5499ab37470d4..0ed7748c1f9e3 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -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 diff --git a/doc/tutorial/control.md b/doc/tutorial/control.md index 966aeb2df523c..fc89218b75152 100644 --- a/doc/tutorial/control.md +++ b/doc/tutorial/control.md @@ -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) } }