diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-09-01 18:24:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-01 18:24:23 -0700 |
| commit | 383da5e1e670c5028731aa3e477578e5e97c6e52 (patch) | |
| tree | d83c292394881f9bb0fa251d957ddc76499d1f27 | |
| parent | 130359cb05246fcacdde61baa2613419ef6570c7 (diff) | |
| parent | f3d7645fb79d641de447d4af02d5f3cee91b4af3 (diff) | |
| download | rust-383da5e1e670c5028731aa3e477578e5e97c6e52.tar.gz rust-383da5e1e670c5028731aa3e477578e5e97c6e52.zip | |
Rollup merge of #74880 - chrisduerr:fix_matches, r=dtolnay
Add trailing comma support to matches macro
| -rw-r--r-- | library/core/src/macros/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 4e0da1fc4a6..a1b0821004b 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -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 |
