diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
| commit | c73ab25c9dbe40284cfd38beaf31e2a20a9810de (patch) | |
| tree | 51c5817a0c252a172c03a47e36886e563a4e623d /engine/src/windowing/mouse.rs | |
| parent | 2ccda0cd5f81909fddc74d95f960f781a64bcae1 (diff) | |
refactor(engine): fix portion of clippy lints
Diffstat (limited to 'engine/src/windowing/mouse.rs')
| -rw-r--r-- | engine/src/windowing/mouse.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/src/windowing/mouse.rs b/engine/src/windowing/mouse.rs index 3a43e79..a5e4cc8 100644 --- a/engine/src/windowing/mouse.rs +++ b/engine/src/windowing/mouse.rs @@ -31,6 +31,7 @@ pub struct ScrollDelta impl ScrollDelta { + #[must_use] pub fn is_zero(&self) -> bool { self.vert_lines == 0.0 && self.hor_lines == 0.0 @@ -46,6 +47,7 @@ pub struct Buttons impl Buttons { + #[must_use] pub fn get(&self, button: Button) -> ButtonState { let Some(button_data) = self.map.get(&button) else { @@ -55,6 +57,7 @@ impl Buttons button_data.current_state } + #[must_use] pub fn get_previous(&self, button: Button) -> ButtonState { let Some(button_data) = self.map.get(&button) else { @@ -70,7 +73,7 @@ impl Buttons { self.map .iter() - .map(|(button, button_data)| (button.clone(), button_data.current_state)) + .map(|(button, button_data)| (*button, button_data.current_state)) } pub fn set(&mut self, button: Button, button_state: ButtonState) @@ -120,7 +123,7 @@ impl intmap::IntKey for Button Self::Middle => 2, Self::Back => 3, Self::Forward => 4, - Self::Other(other) => 5 + *other as u32, + Self::Other(other) => 5 + u32::from(*other), } } } |
