| 1 | macro_rules! assert_matchesrust-analyzer cargo bendy 0.6.1 assert_matches/assert_matches! { |
| 2 | ($expression:expr, $pattern:pat $( if $guard:expr )?) => { |
| 3 | match $expression { |
| 4 | $pattern $( if $guard )? => {} |
| 5 | left => panic!( |
| 6 | "assertion failed: (left ~= right)\n left: `{:?}`\n right: `{}`", |
| 7 | left, |
| 8 | stringify!($pattern $(if $guard)?) |
| 9 | ), |
| 10 | } |
| 11 | } |
| 12 | } |