Fix clippy::needless_borrow lint violations (#36444)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-18 23:54:35 +02:00 committed by GitHub
parent eecf142f06
commit 9e0e233319
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
242 changed files with 801 additions and 821 deletions

View file

@ -439,17 +439,17 @@ pub fn start_of_excerpt(
};
match direction {
Direction::Prev => {
let mut start = excerpt.start_anchor().to_display_point(&map);
let mut start = excerpt.start_anchor().to_display_point(map);
if start >= display_point && start.row() > DisplayRow(0) {
let Some(excerpt) = map.buffer_snapshot.excerpt_before(excerpt.id()) else {
return display_point;
};
start = excerpt.start_anchor().to_display_point(&map);
start = excerpt.start_anchor().to_display_point(map);
}
start
}
Direction::Next => {
let mut end = excerpt.end_anchor().to_display_point(&map);
let mut end = excerpt.end_anchor().to_display_point(map);
*end.row_mut() += 1;
map.clip_point(end, Bias::Right)
}
@ -467,7 +467,7 @@ pub fn end_of_excerpt(
};
match direction {
Direction::Prev => {
let mut start = excerpt.start_anchor().to_display_point(&map);
let mut start = excerpt.start_anchor().to_display_point(map);
if start.row() > DisplayRow(0) {
*start.row_mut() -= 1;
}
@ -476,7 +476,7 @@ pub fn end_of_excerpt(
start
}
Direction::Next => {
let mut end = excerpt.end_anchor().to_display_point(&map);
let mut end = excerpt.end_anchor().to_display_point(map);
*end.column_mut() = 0;
if end <= display_point {
*end.row_mut() += 1;
@ -485,7 +485,7 @@ pub fn end_of_excerpt(
else {
return display_point;
};
end = excerpt.end_anchor().to_display_point(&map);
end = excerpt.end_anchor().to_display_point(map);
*end.column_mut() = 0;
}
end