summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exercises/21_macros/macros1.rs1
-rw-r--r--rustlings-macros/info.toml5
-rw-r--r--solutions/21_macros/macros1.rs11
3 files changed, 13 insertions, 4 deletions
diff --git a/exercises/21_macros/macros1.rs b/exercises/21_macros/macros1.rs
index 1d415cb..fb3c3ff 100644
--- a/exercises/21_macros/macros1.rs
+++ b/exercises/21_macros/macros1.rs
@@ -5,5 +5,6 @@ macro_rules! my_macro {
}
fn main() {
+ // TODO: Fix the macro call.
my_macro();
}
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml
index 24dcdee..7dcf344 100644
--- a/rustlings-macros/info.toml
+++ b/rustlings-macros/info.toml
@@ -1089,9 +1089,8 @@ name = "macros1"
dir = "21_macros"
test = false
hint = """
-When you call a macro, you need to add something special compared to a
-regular function call. If you're stuck, take a look at what's inside
-`my_macro`."""
+When you call a macro, you need to add something special compared to a regular
+function call."""
[[exercises]]
name = "macros2"
diff --git a/solutions/21_macros/macros1.rs b/solutions/21_macros/macros1.rs
index 4e18198..1b86156 100644
--- a/solutions/21_macros/macros1.rs
+++ b/solutions/21_macros/macros1.rs
@@ -1 +1,10 @@
-// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
+macro_rules! my_macro {
+ () => {
+ println!("Check out my macro!");
+ };
+}
+
+fn main() {
+ my_macro!();
+ // ^
+}