xxxxxxxxxx
#[export_macro]
macro_rules! foo {
() => {};
}
// You can use it like so:
use my_crate::foo;
// Notice that the macro is exported at the root
xxxxxxxxxx
macro_rules! say_hello_to {
($name:expr) => {
concat!("Hello, ", $name, "!")
};
}
fn main() {
println!("{}", say_hello_to!("Alice"));
}