16 lines
218 B
Rust
16 lines
218 B
Rust
macro_rules! m {
|
|
($expr: expr, $func: ident) => {{
|
|
let x = $expr;
|
|
$func(x)
|
|
}};
|
|
|
|
() => {
|
|
};
|
|
|
|
($item: ident) => {
|
|
mod macro_item {
|
|
struct $item;
|
|
}
|
|
};
|
|
}
|