I've learnt recently that this code:
macro_rules! max {
($a:expr, $b:expr) => (match ($a, $b) {
(a, b) => if a > b { a } else { b }
});
}
is preferable to this code:
macro_rules! max {
($a:expr, $b:expr) => ({
let a = $a;
let b = $b;
if a > b { a } else { b }
});
}