mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
16 lines
293 B
Rust
16 lines
293 B
Rust
//@ run-pass
|
|
|
|
|
|
fn altlit(f: isize) -> isize {
|
|
match f {
|
|
10 => { println!("case 10"); return 20; }
|
|
11 => { println!("case 11"); return 22; }
|
|
_ => panic!("the impossible happened")
|
|
}
|
|
}
|
|
|
|
pub fn main() {
|
|
assert_eq!(altlit(10), 20);
|
|
assert_eq!(altlit(11), 22);
|
|
}
|