Replace all occurrences of 'when' with 'if' in documentation and tutorial.
Also update the naturaldocs keywords file. Closes #1396
This commit is contained in:
parent
070b1c8333
commit
55edb4a04f
@ -17,4 +17,4 @@ self str syntax
|
||||
tag true type
|
||||
u16 u32 u64 u8 uint unchecked unsafe use
|
||||
vec
|
||||
when while with
|
||||
while with
|
||||
|
@ -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
|
||||
|
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user