summaryrefslogtreecommitdiff
path: root/solutions/21_macros/macros3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'solutions/21_macros/macros3.rs')
-rw-r--r--solutions/21_macros/macros3.rs14
1 files changed, 13 insertions, 1 deletions
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!();
+}