feat: add async exercises

This commit is contained in:
liv
2025-05-16 15:53:31 +02:00
parent e73fff3bd4
commit b2b3005670
35 changed files with 268 additions and 36 deletions
+10
View File
@@ -0,0 +1,10 @@
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro!();
// ^
}
+10
View File
@@ -0,0 +1,10 @@
// Moved the macro definition to be before its call.
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro!();
}
+13
View File
@@ -0,0 +1,13 @@
// Added the attribute `macro_use` attribute.
#[macro_use]
mod macros {
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
}
fn main() {
my_macro!();
}
+15
View File
@@ -0,0 +1,15 @@
// Added semicolons to separate the macro arms.
#[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);
}