There's no reason the macro couldn't just accept any of those syntax options.
error: `$key:expr` is followed by `:`, which is not allowed for `expr` fragments
--> src/main.rs:6:15
|
6 | ($key:expr: $value:expr) => {}
| ^ not allowed after `expr` fragments
|
= note: allowed there are: `=>`, `,` or `;`
1 Like
That can be worked around with a more complex macro_rules! or with a proc macro.
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.