From 9845e046de6f9569519d0e0ae3c50341eb35a8bf Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 1 Jul 2024 11:31:37 +0200 Subject: macros2 solution --- solutions/21_macros/macros2.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'solutions/21_macros') 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!(); +} -- cgit v1.2.3