diff options
| author | mo8it <mo8it@proton.me> | 2024-07-01 11:54:05 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-01 11:54:05 +0200 |
| commit | cc2c0958c9ba038e1584f3cbff0b07df4cc490c1 (patch) | |
| tree | 2ef3303fb200976b70c706277689594ae5759b6e /solutions/21_macros | |
| parent | 4cb15a4cda4791134a75a0462031b5e86b45fa0d (diff) | |
macros4 solution
Diffstat (limited to 'solutions/21_macros')
| -rw-r--r-- | solutions/21_macros/macros4.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/solutions/21_macros/macros4.rs b/solutions/21_macros/macros4.rs index 4e18198..41bcad1 100644 --- a/solutions/21_macros/macros4.rs +++ b/solutions/21_macros/macros4.rs @@ -1 +1,15 @@ -// Solutions will be available before the stable release. Thank you for testing the beta version 🥰 +// 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); +} |
