Current Progress: 92/94

This commit is contained in:
2023-06-15 17:30:11 -05:00
parent 1230b6cdb2
commit 05f28181d0
21 changed files with 80 additions and 699 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
// macros1.rs
// Execute `rustlings hint macros1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
macro_rules! my_macro {
() => {
@@ -10,5 +9,5 @@ macro_rules! my_macro {
}
fn main() {
my_macro();
my_macro!();
}
+5 -6
View File
@@ -1,14 +1,13 @@
// macros2.rs
// Execute `rustlings hint macros2` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
fn main() {
my_macro!();
}
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro!();
}
+1 -1
View File
@@ -2,8 +2,8 @@
// Make me compile, without taking the macro out of the module!
// Execute `rustlings hint macros3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
#[macro_use]
mod macros {
macro_rules! my_macro {
() => {
+1 -2
View File
@@ -1,13 +1,12 @@
// macros4.rs
// Execute `rustlings hint macros4` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
#[rustfmt::skip]
macro_rules! my_macro {
() => {
println!("Check out my macro!");
}
};
($val:expr) => {
println!("Look at this other macro: {}", $val);
}