mirror of
https://github.com/notohh/rustlings.git
synced 2025-06-24 20:07:42 -04:00
macros3 solution
This commit is contained in:
parent
9845e046de
commit
4cb15a4cda
3 changed files with 16 additions and 7 deletions
solutions/21_macros
|
@ -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!();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue