Skip to content

Commit

Permalink
Add trailing comma support to matches macro
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisduerr committed Jul 28, 2020
1 parent 2c28244 commit f3d7645
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 @@ -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
Expand Down

0 comments on commit f3d7645

Please sign in to comment.