Use parentheses for cond! macro instead of preceding pipes

This is temporary. Once the macro parser has improved or been re-written these can be removed.
This commit is contained in:
Brendan Zabarauskas 2013-05-10 15:01:27 +10:00
parent b9824e18c2
commit 7e4a176dd3
4 changed files with 14 additions and 14 deletions

View file

@ -10,8 +10,8 @@
fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
cond!(
| x > mx { return mx; }
| x < mn { return mn; }
(x > mx) { return mx; }
(x < mn) { return mn; }
)
return x;
}
@ -20,4 +20,4 @@ fn main() {
assert_eq!(clamp(1, 2, 4), 2);
assert_eq!(clamp(8, 2, 4), 4);
assert_eq!(clamp(3, 2, 4), 3);
}
}

View file

@ -10,8 +10,8 @@
fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
cond!(
| x > mx { mx }
| x < mn { mn }
(x > mx) { mx }
(x < mn) { mn }
_ { x }
)
}
@ -20,4 +20,4 @@ fn main() {
assert_eq!(clamp(1, 2, 4), 2);
assert_eq!(clamp(8, 2, 4), 4);
assert_eq!(clamp(3, 2, 4), 3);
}
}