mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
20 lines
264 B
Rust
20 lines
264 B
Rust
// run-pass
|
|
enum Foo {
|
|
A,
|
|
B,
|
|
C,
|
|
D,
|
|
E,
|
|
}
|
|
use Foo::*;
|
|
|
|
fn main() {
|
|
for foo in &[A, B, C, D, E] {
|
|
match *foo {
|
|
| A => println!("A"),
|
|
| B | C if 1 < 2 => println!("BC!"),
|
|
| _ => {},
|
|
}
|
|
}
|
|
}
|