mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
12 lines
147 B
Rust
12 lines
147 B
Rust
//@ run-pass
|
|
pub fn foo(x: i8) -> i32 {
|
|
match x {
|
|
1 => 0,
|
|
_ => 1,
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(foo(0), 1);
|
|
assert_eq!(foo(1), 0);
|
|
}
|