diff --git a/exercises/test4.rs b/exercises/test4.rs index e50f1b0..8659805 100644 --- a/exercises/test4.rs +++ b/exercises/test4.rs @@ -5,6 +5,13 @@ // Write a macro that passes the test! No hints this time, you can do it! +#[macro_export] +macro_rules! my_macro { + ($x:expr) => {{ + format!("Hello {}", $x) + }}; +} + fn main() { if my_macro!("world!") != "Hello world!" { panic!("Oh no! Wrong output!");