summaryrefslogtreecommitdiff
path: root/solutions/21_macros/macros4.rs
blob: 41bcad166a0d97217c3dfdbc30d3752d5f258d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Added semicolons to separate the macro arms.
#[rustfmt::skip]
macro_rules! my_macro {
    () => {
        println!("Check out my macro!");
    };
    ($val:expr) => {
        println!("Look at this other macro: {}", $val);
    };
}

fn main() {
    my_macro!();
    my_macro!(7777);
}