diff options
Diffstat (limited to 'solutions/21_macros/macros2.rs')
| -rw-r--r-- | solutions/21_macros/macros2.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/solutions/21_macros/macros2.rs b/solutions/21_macros/macros2.rs new file mode 100644 index 0000000..b6fd5d2 --- /dev/null +++ b/solutions/21_macros/macros2.rs @@ -0,0 +1,10 @@ +// Moved the macro definition to be before its call. +macro_rules! my_macro { + () => { + println!("Check out my macro!"); + }; +} + +fn main() { + my_macro!(); +} |
