Skip to content

Commit 383da5e

Browse files
authored
Rollup merge of #74880 - chrisduerr:fix_matches, r=dtolnay
Add trailing comma support to matches macro
2 parents 130359c + f3d7645 commit 383da5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/macros/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ macro_rules! debug_assert_ne {
242242
#[macro_export]
243243
#[stable(feature = "matches_macro", since = "1.42.0")]
244244
macro_rules! matches {
245-
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
245+
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )? $(,)?) => {
246246
match $expression {
247247
$( $pattern )|+ $( if $guard )? => true,
248248
_ => false

0 commit comments

Comments
 (0)