summaryrefslogtreecommitdiff
path: root/engine/src/windowing/mouse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/windowing/mouse.rs')
-rw-r--r--engine/src/windowing/mouse.rs7
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),
}
}
}