Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-19 13:27:24 +00:00
committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
281 changed files with 6625 additions and 7086 deletions
+5 -5
View File
@@ -189,11 +189,11 @@ fn tokenize(text: &str, language_scope: Option<LanguageScope>) -> impl Iterator<
while let Some((ix, c)) = chars.next() {
let mut token = None;
let kind = classifier.kind(c);
if let Some((prev_char, prev_kind)) = prev {
if kind != prev_kind || (kind == CharKind::Punctuation && c != prev_char) {
token = Some(&text[start_ix..ix]);
start_ix = ix;
}
if let Some((prev_char, prev_kind)) = prev
&& (kind != prev_kind || (kind == CharKind::Punctuation && c != prev_char))
{
token = Some(&text[start_ix..ix]);
start_ix = ix;
}
prev = Some((c, kind));
if token.is_some() {