2012-05-30 12:38:58 -05:00
|
|
|
type an_int = int;
|
|
|
|
|
2012-08-20 14:23:37 -05:00
|
|
|
fn cmp(x: Option<an_int>, y: Option<int>) -> bool {
|
2012-05-30 12:38:58 -05:00
|
|
|
x == y
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-20 14:23:37 -05:00
|
|
|
assert !cmp(Some(3), None);
|
|
|
|
assert !cmp(Some(3), Some(4));
|
|
|
|
assert cmp(Some(3), Some(3));
|
|
|
|
assert cmp(None, None);
|
2012-05-30 12:38:58 -05:00
|
|
|
}
|