Skip to content

Commit f3d7645

Browse files
committed
Add trailing comma support to matches macro
1 parent 2c28244 commit f3d7645

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/macros/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ macro_rules! debug_assert_ne {
255255
#[macro_export]
256256
#[stable(feature = "matches_macro", since = "1.42.0")]
257257
macro_rules! matches {
258-
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
258+
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )? $(,)?) => {
259259
match $expression {
260260
$( $pattern )|+ $( if $guard )? => true,
261261
_ => false

0 commit comments

Comments
 (0)