We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c9b490 commit 4fb790dCopy full SHA for 4fb790d
src/flow_control/match/binding.md
@@ -25,6 +25,8 @@ fn main() {
25
// Now the age can be reported.
26
n @ 1 ..= 12 => println!("I'm a child of age {:?}", n),
27
n @ 13 ..= 19 => println!("I'm a teen of age {:?}", n),
28
+ // A similar binding can be done when matching several values.
29
+ n @ (1 | 7 | 15 | 13) => println!("I'm a teen of age {:?}", n),
30
// Nothing bound. Return the result.
31
n => println!("I'm an old person of age {:?}", n),
32
}
0 commit comments