coerce_pattern
coerce_pattern is a Rust library crate containing macros that force expressions into patterns. It is version-controlled on GitHub here.
This crate contains two proc macros relating to asserting, under penalty of panic, that expressions match patterns.
coerce_pattern!matches an expression to a target pattern and evaluates to an expression of the inner variables from the pattern, panicking if the pattern doesn't matchassert_pattern!matches an expression to a target and panics if the pattern doesn't match.
To use them, run the following command in your project directory.
Then, you can use the macros using
use ;
See the documentation in src/lib.rs for more details