summaryrefslogtreecommitdiff
path: root/solutions/21_macros/macros2.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-01 11:31:37 +0200
committermo8it <mo8it@proton.me>2024-07-01 11:31:37 +0200
commit9845e046de6f9569519d0e0ae3c50341eb35a8bf (patch)
tree6e0ae428d0bb46b158fc807af09faf011408023c /solutions/21_macros/macros2.rs
parentcf90364fd779255074eac9a7d90c53ad657936ba (diff)
macros2 solution
Diffstat (limited to 'solutions/21_macros/macros2.rs')
-rw-r--r--solutions/21_macros/macros2.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/solutions/21_macros/macros2.rs b/solutions/21_macros/macros2.rs
index 4e18198..b6fd5d2 100644
--- a/solutions/21_macros/macros2.rs
+++ b/solutions/21_macros/macros2.rs
@@ -1 +1,10 @@
-// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
+// Moved the macro definition to be before its call.
+macro_rules! my_macro {
+ () => {
+ println!("Check out my macro!");
+ };
+}
+
+fn main() {
+ my_macro!();
+}