summaryrefslogtreecommitdiffstats
path: root/examples/05_enum.rs
blob: 304ad04e4480d9135e02dfcb4318fcf4e96ead7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
enum Color {
    Red,
    Green,
    Blue,
}

fn main () {
    let c = Red;
    println!("{}", match c { Red => "r", Green => "g", Blue => "b" });
}