Files
Rust-High-Performance/Chapter09/example1.rs
2018-03-28 11:19:46 +05:30

10 lines
216 B
Rust

macro_rules! add {
{one to $input:expr} => ($input + 1);
{two to $input:expr} => ($input + 2);
}
fn main() {
println!("Add one: {}", add!(one to 25/5));
println!("Add two: {}", add!(two to 25/5));
}