cond
Rust macro to use a match-like syntax as an elegant alternative to many if-else statements.
I got the idea from empty Go switch statements. I thought it could be cool if it was in Rust so I asked if that was possible in the Rust community Discord server. They told me it wasn't unless you used a pretty ugly syntax in a match, and Esper89 (GitHub in credits) made a macro for it. I added some tests and documentation and here's my first Rust crate.
Example
use cond;
Usage
You can just add the crate with:
Or just add the 8 line macro to your project:
Credits
Credits to Esper89 for essentially making the whole macro in the Rust community Discord server.