macro_rules! tern_py {
({ $if_expr:expr } if ($cond:expr) else { $else_expr:expr }) => { ... };
}
Expand description
The same as tern_python
macro but shorter:
let y = 4;
let x = tern_py! { { "it's even" } if (y & 1 == 0) else { "it's odd" } };
println!("{} is {}", y, x);