From d4d2113bacdc21f5823278868e04bde6844da67b Mon Sep 17 00:00:00 2001 From: Etho <58352929+EthoIRL@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:33:34 -0700 Subject: [PATCH] Update bin-mouse.rs --- src/example/bin-mouse.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/example/bin-mouse.rs b/src/example/bin-mouse.rs index c4ca699..46fd8a2 100644 --- a/src/example/bin-mouse.rs +++ b/src/example/bin-mouse.rs @@ -69,12 +69,9 @@ pub fn main() { for mouse in mouses.iter() { let movement_receiver = mouse.get_movement(); - match movement_receiver.try_recv() { - Ok(movement) => { - println!("X: {} | Y: {} | WHEEL: {}", movement.relative_x, movement.relative_y, movement.relative_wheel); - }, - Err(_) => {} - }; + if let Ok(movement) = movement_receiver.try_recv() { + println!("X: {} | Y: {} | WHEEL: {}", movement.relative_x, movement.relative_y, movement.relative_wheel); + } } });