Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
+12
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user