diff options
| author | mo8it <mo8it@proton.me> | 2024-07-01 11:37:48 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-01 11:37:48 +0200 |
| commit | 4cb15a4cda4791134a75a0462031b5e86b45fa0d (patch) | |
| tree | 9bdda04ab2238a2e7d41ebd13ecc8393d0670bbc /solutions | |
| parent | 9845e046de6f9569519d0e0ae3c50341eb35a8bf (diff) | |
macros3 solution
Diffstat (limited to 'solutions')
| -rw-r--r-- | solutions/21_macros/macros3.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/solutions/21_macros/macros3.rs b/solutions/21_macros/macros3.rs index 4e18198..df35be4 100644 --- a/solutions/21_macros/macros3.rs +++ b/solutions/21_macros/macros3.rs @@ -1 +1,13 @@ -// Solutions will be available before the stable release. Thank you for testing the beta version 🥰 +// Added the attribute `macro_use` attribute. +#[macro_use] +mod macros { + macro_rules! my_macro { + () => { + println!("Check out my macro!"); + }; + } +} + +fn main() { + my_macro!(); +} |
