Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 27, 2018 21:54
Show Gist options
  • Save rust-play/d027d097ab24f6d90d0862fdb338181d to your computer and use it in GitHub Desktop.
Save rust-play/d027d097ab24f6d90d0862fdb338181d to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#![allow(unused)]
macro_rules! nested {
($x:expr) => { ($x) };
($x:expr, $($rest:expr),+) => {
(
$x,
nested!($($rest),*)
)
};
}
fn main() {
let result = nested!(1, 2, 3);
println!("{:?}", result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment