Skip to content

Commit

Permalink
Rollup merge of #74880 - chrisduerr:fix_matches, r=dtolnay
Browse files Browse the repository at this point in the history
Add trailing comma support to matches macro
  • Loading branch information
tmandry authored Sep 2, 2020
2 parents 130359c + f3d7645 commit 383da5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,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
Expand Down

0 comments on commit 383da5e

Please sign in to comment.