mirror of
https://github.com/PacktPublishing/Rust-High-Performance.git
synced 2026-01-25 02:34:19 +09:00
10 lines
179 B
Rust
10 lines
179 B
Rust
macro_rules! add_to_vec {
|
|
($( $x:expr; [ $( $y:expr ),* ]);* ) => {
|
|
&[ $($( $x + $y ),*),* ]
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
println!("{:?}", add_to_vec![10; [5, 5, 10]]);
|
|
}
|