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