summaryrefslogblamecommitdiffstats
path: root/examples/06_enum-nonexhaustive.rs
blob: 14d5bc8cb003ef1fd06aa2f0a2f151042ae95046 (plain) (tree)
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" });
}