Rollup merge of #135882 - hkBst:master, r=estebank
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]` All uses immediately invoke contains, so maybe a further simplification is possible.
This commit is contained in:
commit
78ded09912
4 changed files with 18 additions and 22 deletions
|
@ -3114,9 +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()
|
||||
.is_some_and(|similar_tokens| 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue