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