mirror of
https://github.com/PacktPublishing/Rust-High-Performance.git
synced 2026-01-25 02:34:19 +09:00
10 lines
216 B
Rust
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));
|
|
}
|