summaryrefslogtreecommitdiff
path: root/solutions/21_macros
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-01 11:37:48 +0200
committermo8it <mo8it@proton.me>2024-07-01 11:37:48 +0200
commit4cb15a4cda4791134a75a0462031b5e86b45fa0d (patch)
tree9bdda04ab2238a2e7d41ebd13ecc8393d0670bbc /solutions/21_macros
parent9845e046de6f9569519d0e0ae3c50341eb35a8bf (diff)
macros3 solution
Diffstat (limited to 'solutions/21_macros')
-rw-r--r--solutions/21_macros/macros3.rs14
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!();
+}