You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
368 B
22 lines
368 B
3 years ago
|
#![allow(dead_code)]
|
||
|
|
||
|
enum Number {
|
||
|
Zero,
|
||
|
One,
|
||
|
Two,
|
||
|
}
|
||
|
|
||
|
enum Color {
|
||
|
Red = 0xff0000,
|
||
|
Green = 0x00ff00,
|
||
|
Blue = 0x0000ff,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
println!("zero is {}", Number::Zero as i32);
|
||
|
println!("one is {}", Number::One as i32);
|
||
|
|
||
|
println!("roses are #{:06x}", Color::Red as i32);
|
||
|
println!("violets are #{:06x}", Color::Blue as i32);
|
||
|
}
|