Fix clippy::needless_borrow lint violations (#36444)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-18 21:54:35 +00:00
committed by GitHub
parent eecf142f06
commit 9e0e233319
242 changed files with 801 additions and 821 deletions
@@ -77,7 +77,7 @@ fn create_highlight_endpoints(
let ranges = &text_highlights.1;
let start_ix = match ranges.binary_search_by(|probe| {
let cmp = probe.end.cmp(&start, &buffer);
let cmp = probe.end.cmp(&start, buffer);
if cmp.is_gt() {
cmp::Ordering::Greater
} else {
@@ -88,18 +88,18 @@ fn create_highlight_endpoints(
};
for range in &ranges[start_ix..] {
if range.start.cmp(&end, &buffer).is_ge() {
if range.start.cmp(&end, buffer).is_ge() {
break;
}
highlight_endpoints.push(HighlightEndpoint {
offset: range.start.to_offset(&buffer),
offset: range.start.to_offset(buffer),
is_start: true,
tag,
style,
});
highlight_endpoints.push(HighlightEndpoint {
offset: range.end.to_offset(&buffer),
offset: range.end.to_offset(buffer),
is_start: false,
tag,
style,
+3 -3
View File
@@ -36,8 +36,8 @@ pub fn is_invisible(c: char) -> bool {
} else if c >= '\u{7f}' {
c <= '\u{9f}'
|| (c.is_whitespace() && c != IDEOGRAPHIC_SPACE)
|| contains(c, &FORMAT)
|| contains(c, &OTHER)
|| contains(c, FORMAT)
|| contains(c, OTHER)
} else {
false
}
@@ -50,7 +50,7 @@ pub fn replacement(c: char) -> Option<&'static str> {
Some(C0_SYMBOLS[c as usize])
} else if c == '\x7f' {
Some(DEL)
} else if contains(c, &PRESERVE) {
} else if contains(c, PRESERVE) {
None
} else {
Some("\u{2007}") // fixed width space
+1 -1
View File
@@ -1461,7 +1461,7 @@ mod tests {
}
let mut prev_ix = 0;
for boundary in line_wrapper.wrap_line(&[LineFragment::text(&line)], wrap_width) {
for boundary in line_wrapper.wrap_line(&[LineFragment::text(line)], wrap_width) {
wrapped_text.push_str(&line[prev_ix..boundary.ix]);
wrapped_text.push('\n');
wrapped_text.push_str(&" ".repeat(boundary.next_indent as usize));