diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-30 12:45:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-30 12:45:27 +0100 |
| commit | 78ded09912a6f64ab83978ab70b40ef7ff94b833 (patch) | |
| tree | 1c65d3230e153bfb880df0f043dda92499b9a15e /compiler/rustc_parse/src/parser/mod.rs | |
| parent | aedc0a34a842a3ec50a6d1d83a9fb98d5b1b9f3a (diff) | |
| parent | 5f01e12ea8035fdfc23eefaf6b580dbb9a8863ec (diff) | |
| download | rust-78ded09912a6f64ab83978ab70b40ef7ff94b833.tar.gz rust-78ded09912a6f64ab83978ab70b40ef7ff94b833.zip | |
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.
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 714a60cb179..faebb5a40bb 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -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(); } } } |
