intermodal/src/matches.rs

9 lines
192 B
Rust
Raw Normal View History

2019-05-24 10:25:55 +02:00
macro_rules! matches {
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
match $expression {
$( $pattern )|+ $( if $guard )? => true,
_ => false
}
}
}