macros2 solution

This commit is contained in:
mo8it 2024-07-01 11:31:37 +02:00
parent cf90364fd7
commit 9845e046de
2 changed files with 11 additions and 1 deletions

View file

@ -2,6 +2,7 @@ fn main() {
my_macro!(); my_macro!();
} }
// TODO: Fix the compiler error by moving the whole definition of this macro.
macro_rules! my_macro { macro_rules! my_macro {
() => { () => {
println!("Check out my macro!"); println!("Check out my macro!");

View file

@ -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!();
}