Skip to content

Commit 55edb4a

Browse files
Austin Seippbrson
authored andcommitted
Replace all occurrences of 'when' with 'if' in documentation and tutorial.
Also update the naturaldocs keywords file. Closes #1396
1 parent 070b1c8 commit 55edb4a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/keywords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ self str syntax
1717
tag true type
1818
u16 u32 u64 u8 uint unchecked unsafe use
1919
vec
20-
when while with
20+
while with

doc/rust.texi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,12 +3331,12 @@ let message = alt x @{
33313331

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

33373337
@example
33383338
let message = alt maybe_digit @{
3339-
some(x) when x < 10 @{ process_digit(x) @}
3339+
some(x) if x < 10 @{ process_digit(x) @}
33403340
some(x) @{ process_other(x) @}
33413341
@}
33423342
@end example

doc/tutorial/control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ that `(float, float)` is a tuple of two floats:
6767

6868
fn angle(vec: (float, float)) -> float {
6969
alt vec {
70-
(0f, y) when y < 0f { 1.5 * std::math::pi }
70+
(0f, y) if y < 0f { 1.5 * std::math::pi }
7171
(0f, y) { 0.5 * std::math::pi }
7272
(x, y) { std::math::atan(y / x) }
7373
}

0 commit comments

Comments
 (0)