rustlings/macros/macros1.rs

64 lines
373 B
Rust
Raw Normal View History

2017-03-17 17:30:29 +03:00
// Make me compile! Scroll down for hints :)
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro();
}
2017-03-19 17:10:48 +03:00
// When you call a macro, you need to add something special compared to a
// regular function call. If you're stuck, take a look at what's inside
// `my_macro`.