1
Fork 0

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
commit 78ded09912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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();
}
}
}