From f3d7645fb79d641de447d4af02d5f3cee91b4af3 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Tue, 28 Jul 2020 18:42:13 +0200 Subject: [PATCH] Add trailing comma support to matches macro --- library/core/src/macros/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 3b9057b7e8377..c92ca22509afc 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -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