bluss/maplit

convert_args! doesn't work with vec! and square brackets

tecywiz121 opened this issue · 3 comments

This is a fairly minor issue, but is annoying since we use rustfmt.

For better or worse, rustfmt converts vec!(...) to vec![...]. If you use convert_args!(vec!(...)) it compiles just fine, but convert_args!(vec![...]) does not.

bluss commented

Combining macros like this was deemed idiomatic (see nom, it prefers ()'s), so it seems like an issue with rustfmt.

bluss commented

Since vec is not defined in this crate, I'll decline this issue with the above comment for now; convert_args is designed for the macros in this crate, even though I of course understand that it can be used more widely.

Would you accept a PR expanding the macro with another pattern that matches other bracket types?