]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/src/main.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / doc / book / listings / ch06-enums-and-pattern-matching / no-listing-15-binding-catchall / src / main.rs
1 fn main() {
2 // ANCHOR: here
3 let dice_roll = 9;
4 match dice_roll {
5 3 => add_fancy_hat(),
6 7 => remove_fancy_hat(),
7 other => move_player(other),
8 }
9
10 fn add_fancy_hat() {}
11 fn remove_fancy_hat() {}
12 fn move_player(num_spaces: u8) {}
13 // ANCHOR_END: here
14 }