summaryrefslogtreecommitdiff
path: root/rustlings/exercises/21_macros
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-10-02 21:53:51 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-10-02 21:53:51 -0500
commit4dfc11d74ab02ac5765ae5d08fb750c91f4744b4 (patch)
tree17ba62056d6b691dd0217b0e8f1b3a5826dce0f6 /rustlings/exercises/21_macros
parent02d8f1c62896576e1266553a56980eddbc2a88d7 (diff)
rustlings: move to rust/
Diffstat (limited to 'rustlings/exercises/21_macros')
-rw-r--r--rustlings/exercises/21_macros/README.md15
-rw-r--r--rustlings/exercises/21_macros/macros1.rs10
-rw-r--r--rustlings/exercises/21_macros/macros2.rs10
-rw-r--r--rustlings/exercises/21_macros/macros3.rs13
-rw-r--r--rustlings/exercises/21_macros/macros4.rs15
5 files changed, 0 insertions, 63 deletions
diff --git a/rustlings/exercises/21_macros/README.md b/rustlings/exercises/21_macros/README.md
deleted file mode 100644
index de7fb7b..0000000
--- a/rustlings/exercises/21_macros/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Macros
-
-Rust's macro system is very powerful, but also kind of difficult to wrap your
-head around. We're not going to teach you how to write your own fully-featured
-macros. Instead, we'll show you how to use and create them.
-
-If you'd like to learn more about writing your own macros, the
-[macrokata](https://github.com/tfpk/macrokata) project has a similar style
-of exercises to Rustlings, but is all about learning to write Macros.
-
-## Further information
-
-- [The Rust Book - Macros](https://doc.rust-lang.org/book/ch20-05-macros.html)
-- [The Little Book of Rust Macros](https://veykril.github.io/tlborm/)
-- [Rust by Example - macro_rules!](https://doc.rust-lang.org/rust-by-example/macros.html)
diff --git a/rustlings/exercises/21_macros/macros1.rs b/rustlings/exercises/21_macros/macros1.rs
deleted file mode 100644
index fb3c3ff..0000000
--- a/rustlings/exercises/21_macros/macros1.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-macro_rules! my_macro {
- () => {
- println!("Check out my macro!");
- };
-}
-
-fn main() {
- // TODO: Fix the macro call.
- my_macro();
-}
diff --git a/rustlings/exercises/21_macros/macros2.rs b/rustlings/exercises/21_macros/macros2.rs
deleted file mode 100644
index 2d9dec7..0000000
--- a/rustlings/exercises/21_macros/macros2.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-fn main() {
- my_macro!();
-}
-
-// TODO: Fix the compiler error by moving the whole definition of this macro.
-macro_rules! my_macro {
- () => {
- println!("Check out my macro!");
- };
-}
diff --git a/rustlings/exercises/21_macros/macros3.rs b/rustlings/exercises/21_macros/macros3.rs
deleted file mode 100644
index 9537494..0000000
--- a/rustlings/exercises/21_macros/macros3.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// TODO: Fix the compiler error without taking the macro definition out of this
-// module.
-mod macros {
- macro_rules! my_macro {
- () => {
- println!("Check out my macro!");
- };
- }
-}
-
-fn main() {
- my_macro!();
-}
diff --git a/rustlings/exercises/21_macros/macros4.rs b/rustlings/exercises/21_macros/macros4.rs
deleted file mode 100644
index 9d77f6a..0000000
--- a/rustlings/exercises/21_macros/macros4.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// TODO: Fix the compiler error by adding one or two characters.
-#[rustfmt::skip]
-macro_rules! my_macro {
- () => {
- println!("Check out my macro!");
- }
- ($val:expr) => {
- println!("Look at this other macro: {}", $val);
- }
-}
-
-fn main() {
- my_macro!();
- my_macro!(7777);
-}