Created
May 27, 2018 21:54
-
-
Save rust-play/d027d097ab24f6d90d0862fdb338181d to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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