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:
Matthias Krüger
2025-01-30 12:45:27 +01:00
committed by GitHub
4 changed files with 18 additions and 22 deletions

View File

@@ -924,10 +924,8 @@ impl<'a> Parser<'a> {
_ => {
// Attempt to keep parsing if it was a similar separator.
if let Some(tokens) = exp.tok.similar_tokens() {
if tokens.contains(&self.token.kind) {
self.bump();
}
if exp.tok.similar_tokens().contains(&self.token.kind) {
self.bump();
}
}
}