1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Enable a few more clippy lints (#8064)

Enable these new clippy lints and fix all warnings:

* `format_push_string` — use `write!` instead of `s += &format!(…)` to
avoid extra allocations
* `ignored_unit_patterns` — use `()` instead of `_` when matching unit
* `missing_fields_in_debug` — ensure manual `Debug` impls account for
all fields
* `needless_raw_string_hashes` — remove unnecessary `r#` on string
literals
* `ref_option` — prefer `Option<&T>` over `&Option<T>` in function
signatures
This commit is contained in:
Emil Ernerfeldt
2026-04-04 16:20:29 +02:00
committed by GitHub
parent 8ada641ee2
commit 4a09782fce
17 changed files with 100 additions and 53 deletions

View File

@@ -996,7 +996,7 @@ impl<'a> TableBody<'a> {
overline: false,
response: &mut response,
});
self.capture_hover_state(&response, self.row_index);
self.capture_hover_state(response.as_ref(), self.row_index);
let bottom_y = self.layout.cursor.y;
if Some(self.row_index) == self.scroll_to_row {
@@ -1078,7 +1078,7 @@ impl<'a> TableBody<'a> {
overline: false,
response: &mut response,
});
self.capture_hover_state(&response, row_index);
self.capture_hover_state(response.as_ref(), row_index);
}
if total_rows - max_row > 0 {
@@ -1160,7 +1160,7 @@ impl<'a> TableBody<'a> {
overline: false,
response: &mut response,
});
self.capture_hover_state(&response, row_index);
self.capture_hover_state(response.as_ref(), row_index);
break;
}
}
@@ -1183,7 +1183,7 @@ impl<'a> TableBody<'a> {
selected: false,
response: &mut response,
});
self.capture_hover_state(&response, row_index);
self.capture_hover_state(response.as_ref(), row_index);
cursor_y += (row_height + spacing.y) as f64;
if Some(row_index) == self.scroll_to_row {
@@ -1234,8 +1234,8 @@ impl<'a> TableBody<'a> {
// Capture the hover information for the just created row. This is used in the next render
// to ensure that the entire row is highlighted.
fn capture_hover_state(&self, response: &Option<Response>, row_index: usize) {
let is_row_hovered = response.as_ref().is_some_and(|r| r.hovered());
fn capture_hover_state(&self, response: Option<&Response>, row_index: usize) {
let is_row_hovered = response.is_some_and(|r| r.hovered());
if is_row_hovered {
self.layout
.ui