Navigation Menu

Skip to content

Commit

Permalink
add a line to the example to clarify semantics
Browse files Browse the repository at this point in the history
This is to clarify that match construct doesn't define a new variable, since I
observed a person reading the Rust tutorial who seemed to incorrectly think
that it did. Fixes #13571 .
  • Loading branch information
zooko authored and alexcrichton committed May 14, 2014
1 parent ef23fa1 commit 0004953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/tutorial.md
Expand Up @@ -455,7 +455,7 @@ against each pattern in order until one matches. The matching pattern
executes its corresponding arm.
~~~~
# let my_number = 1;
let my_number = 1;
match my_number {
0 => println!("zero"),
1 | 2 => println!("one or two"),
Expand Down

0 comments on commit 0004953

Please sign in to comment.