2018-12-16 21:21:47 -06:00
|
|
|
enum Color { Rgb(isize, isize, isize), Rgba(isize, isize, isize, isize), }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() {
|
2018-12-16 21:21:47 -06:00
|
|
|
let red: Color = Color::Rgb(255, 0, 0);
|
2012-08-06 14:34:08 -05:00
|
|
|
match red {
|
2018-12-07 12:15:36 -06:00
|
|
|
Color::Rgb(r, g, b) => { println!("rgb"); }
|
|
|
|
Color::Hsl(h, s, l) => { println!("hsl"); }
|
|
|
|
//~^ ERROR no variant
|
2011-12-22 16:42:52 -06:00
|
|
|
}
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|