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
+12 -12
View File
@@ -1811,10 +1811,10 @@ fn previous_word_end(
.ignore_punctuation(ignore_punctuation);
let mut point = point.to_point(map);
if point.column < map.buffer_snapshot.line_len(MultiBufferRow(point.row)) {
if let Some(ch) = map.buffer_snapshot.chars_at(point).next() {
point.column += ch.len_utf8() as u32;
}
if point.column < map.buffer_snapshot.line_len(MultiBufferRow(point.row))
&& let Some(ch) = map.buffer_snapshot.chars_at(point).next()
{
point.column += ch.len_utf8() as u32;
}
for _ in 0..times {
let new_point = movement::find_preceding_boundary_point(
@@ -1986,10 +1986,10 @@ fn previous_subword_end(
.ignore_punctuation(ignore_punctuation);
let mut point = point.to_point(map);
if point.column < map.buffer_snapshot.line_len(MultiBufferRow(point.row)) {
if let Some(ch) = map.buffer_snapshot.chars_at(point).next() {
point.column += ch.len_utf8() as u32;
}
if point.column < map.buffer_snapshot.line_len(MultiBufferRow(point.row))
&& let Some(ch) = map.buffer_snapshot.chars_at(point).next()
{
point.column += ch.len_utf8() as u32;
}
for _ in 0..times {
let new_point = movement::find_preceding_boundary_point(
@@ -2054,10 +2054,10 @@ pub(crate) fn last_non_whitespace(
let classifier = map.buffer_snapshot.char_classifier_at(from.to_point(map));
// NOTE: depending on clip_at_line_end we may already be one char back from the end.
if let Some((ch, _)) = map.buffer_chars_at(end_of_line).next() {
if classifier.kind(ch) != CharKind::Whitespace {
return end_of_line.to_display_point(map);
}
if let Some((ch, _)) = map.buffer_chars_at(end_of_line).next()
&& classifier.kind(ch) != CharKind::Whitespace
{
return end_of_line.to_display_point(map);
}
for (ch, offset) in map.reverse_buffer_chars_at(end_of_line) {