Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[macro_export]
- macro_rules! separator {
- () => { "/" };
- }
- #[macro_export]
- macro_rules! concat_separator {
- ( $e:literal, $($other:literal),+ ) => {
- concat!($e, $crate::separator!(), $crate::concat_separator!($($other),+))
- };
- ( $e:literal ) => {
- $e
- }
- }
- fn main() {
- println!("{}", concat_separator!(2, 3, 4))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement