diff --git a/exercises/macros/macros1.rs b/exercises/macros/macros1.rs index a7c78a5..2471126 100644 --- a/exercises/macros/macros1.rs +++ b/exercises/macros/macros1.rs @@ -8,7 +8,7 @@ macro_rules! my_macro { } fn main() { - my_macro(); + my_macro!(); } diff --git a/exercises/macros/macros2.rs b/exercises/macros/macros2.rs index bc2e56b..a9024a3 100644 --- a/exercises/macros/macros2.rs +++ b/exercises/macros/macros2.rs @@ -1,16 +1,17 @@ // macros2.rs // Make me compile! Scroll down for hints :) -fn main() { - my_macro!(); -} - macro_rules! my_macro { () => { println!("Check out my macro!"); }; } +fn main() { + my_macro!(); +} + + diff --git a/exercises/macros/macros3.rs b/exercises/macros/macros3.rs index 84c4308..f14f219 100644 --- a/exercises/macros/macros3.rs +++ b/exercises/macros/macros3.rs @@ -2,6 +2,7 @@ // Make me compile, without taking the macro out of the module! Scroll down for hints :) mod macros { + #[macro_export] macro_rules! my_macro { () => { println!("Check out my macro!"); diff --git a/exercises/macros/macros4.rs b/exercises/macros/macros4.rs index d844bb0..9369ff5 100644 --- a/exercises/macros/macros4.rs +++ b/exercises/macros/macros4.rs @@ -4,7 +4,7 @@ macro_rules! my_macro { () => { println!("Check out my macro!"); - } + }; ($val:expr) => { println!("Look at this other macro: {}", $val); }