2018-02-22 01:09:53 -05:00
|
|
|
// macros4.rs
|
2023-05-29 13:39:08 -04:00
|
|
|
//
|
|
|
|
// Execute `rustlings hint macros4` or use the `hint` watch subcommand for a
|
|
|
|
// hint.
|
2017-03-17 10:47:45 -04:00
|
|
|
|
2019-11-11 07:38:24 -05:00
|
|
|
// I AM NOT DONE
|
|
|
|
|
2023-02-23 19:43:23 -05:00
|
|
|
#[rustfmt::skip]
|
2017-03-17 10:47:45 -04:00
|
|
|
macro_rules! my_macro {
|
|
|
|
() => {
|
|
|
|
println!("Check out my macro!");
|
2020-08-26 22:17:03 -04:00
|
|
|
}
|
2017-03-17 10:47:45 -04:00
|
|
|
($val:expr) => {
|
|
|
|
println!("Look at this other macro: {}", $val);
|
2020-08-26 22:17:03 -04:00
|
|
|
}
|
2017-03-17 10:47:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
my_macro!();
|
|
|
|
my_macro!(7777);
|
|
|
|
}
|