metamatch!
A rust proc-macro for generating repetitive match arms.
Match arms for enum variants of different types cannot be combined, even if the match arm bodies are syntactically identical.
This macro implements a simple templating attribute (#[expand])
to automatically stamp out the neccessary copies.
Due to limitations on attributes in stable rust, a functional macro
(metamatch!) is currently required around the full match expression.
Rustfmt and rust-analyzer are fully able to reason about the macro.
Even auto refactorings affecting the #[expand],
like changing the name of an enum variant, work correctly.
Example
use metamatch;