mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
10 lines
290 B
Rust
10 lines
290 B
Rust
enum Color { Rgb(isize, isize, isize), Rgba(isize, isize, isize, isize), }
|
|
|
|
fn main() {
|
|
let red: Color = Color::Rgb(255, 0, 0);
|
|
match red {
|
|
Color::Rgb(r, g, b) => { println!("rgb"); }
|
|
Color::Hsl(h, s, l) => { println!("hsl"); }
|
|
//~^ ERROR no variant
|
|
}
|
|
}
|