2012-04-11 21:45:18 -07:00
|
|
|
fn is_even(&&x: uint) -> bool { (x % 2u) == 0u }
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 16:26:56 -07:00
|
|
|
assert [1u, 3u]/_.min() == 1u;
|
|
|
|
assert [3u, 1u]/_.min() == 1u;
|
2012-08-20 12:23:37 -07:00
|
|
|
assert Some(1u).min() == 1u;
|
2012-04-11 21:45:18 -07:00
|
|
|
|
2012-06-29 16:26:56 -07:00
|
|
|
assert [1u, 3u]/_.max() == 3u;
|
|
|
|
assert [3u, 1u]/_.max() == 3u;
|
2012-08-20 12:23:37 -07:00
|
|
|
assert Some(3u).max() == 3u;
|
2012-06-29 16:26:56 -07:00
|
|
|
}
|