feat: completed solutions
This commit is contained in:
@@ -6,5 +6,5 @@ macro_rules! my_macro {
|
||||
|
||||
fn main() {
|
||||
// TODO: Fix the macro call.
|
||||
my_macro();
|
||||
my_macro!();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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!");
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
my_macro!();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// TODO: Fix the compiler error without taking the macro definition out of this
|
||||
// module.
|
||||
mod macros {
|
||||
#[macro_export]
|
||||
macro_rules! my_macro {
|
||||
() => {
|
||||
println!("Check out my macro!");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
macro_rules! my_macro {
|
||||
() => {
|
||||
println!("Check out my macro!");
|
||||
}
|
||||
};
|
||||
($val:expr) => {
|
||||
println!("Look at this other macro: {}", $val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user