Skip to content

Commit 69155ab

Browse files
committed
use if matches! in assert.rs
1 parent 3a014e2 commit 69155ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_builtin_macros/src/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn parse_assert<'a>(cx: &ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PResult<
139139
//
140140
// Emit an error and suggest inserting a comma.
141141
let custom_message =
142-
if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token.kind {
142+
if matches!(parser.token.kind, token::Literal(token::Lit { kind: token::Str, .. })) {
143143
let comma = parser.prev_token.span.shrink_to_hi();
144144
cx.dcx().emit_err(errors::AssertMissingComma { span: parser.token.span, comma });
145145

0 commit comments

Comments
 (0)