Skip to content

Commit dfe4c49

Browse files
Use Edition 2021 :pat in matches macro
This makes the macro syntax used in documentation more readable.
1 parent f63ccaf commit dfe4c49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/macros/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ pub macro debug_assert_matches($($arg:tt)*) {
340340
#[stable(feature = "matches_macro", since = "1.42.0")]
341341
#[cfg_attr(not(test), rustc_diagnostic_item = "matches_macro")]
342342
macro_rules! matches {
343-
($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => {
343+
($expression:expr, $pattern:pat $(if $guard:expr)? $(,)?) => {
344344
match $expression {
345-
$( $pattern )|+ $( if $guard )? => true,
345+
$pattern $(if $guard)? => true,
346346
_ => false
347347
}
348348
};

0 commit comments

Comments
 (0)