simplify similar_tokens from Vec<_> to &[_]

This commit is contained in:
Marijn Schouten 2025-01-22 16:50:22 +01:00
parent ccb967438d
commit 5f01e12ea8
2 changed files with 8 additions and 8 deletions

View file

@ -3114,8 +3114,8 @@ impl<'a> Parser<'a> {
let span_before_body = this.prev_token.span;
let arm_body;
let is_fat_arrow = this.check(exp!(FatArrow));
let is_almost_fat_arrow = TokenKind::FatArrow
.similar_tokens().contains(&this.token.kind);
let is_almost_fat_arrow =
TokenKind::FatArrow.similar_tokens().contains(&this.token.kind);
// this avoids the compiler saying that a `,` or `}` was expected even though
// the pattern isn't a never pattern (and thus an arm body is required)