match-template
Overview
match-template is a procedural macro that generates repeated match arms by pattern.
This crate provides a macro that can be used to append a match expression with multiple arms, where the tokens in the first arm, as a template, can be substituted and the template arm will be expanded into multiple arms.
For example, the following code
match_template!
generates
match Foo
In addition, substitution can vary on two sides of the arms.
For example, the following code
match_template!
generates
match Foo
Wildcard match arm is also supported (but there will be no substitution).
License and Origins
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
This repository is a fork of tikv/match-template since the upstream is unmaintained. The original project is licensed under the Apache License, Version 2.0.