mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Add trailing comma support to matches macro
This commit is contained in:
parent
2c28244cf0
commit
f3d7645fb7
@ -255,7 +255,7 @@ macro_rules! debug_assert_ne {
|
||||
#[macro_export]
|
||||
#[stable(feature = "matches_macro", since = "1.42.0")]
|
||||
macro_rules! matches {
|
||||
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
|
||||
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )? $(,)?) => {
|
||||
match $expression {
|
||||
$( $pattern )|+ $( if $guard )? => true,
|
||||
_ => false
|
||||
|
Loading…
Reference in New Issue
Block a user