2012-12-10 13:47:54 -08:00
|
|
|
enum Q { R(Option<uint>) }
|
|
|
|
|
|
|
|
fn xyzzy(q: Q) -> uint {
|
|
|
|
match q {
|
|
|
|
R(S) if S.is_some() => { 0 }
|
|
|
|
_ => 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(xyzzy(R(Some(5))), 0);
|
2012-12-13 13:05:22 -08:00
|
|
|
}
|