rust/hwrunner/src/main.rs
changeset 14709 65c971417780
parent 14705 19122a329774
child 14714 4df1aac5f090
--- a/rust/hwrunner/src/main.rs	Fri Mar 22 21:09:17 2019 +0300
+++ b/rust/hwrunner/src/main.rs	Fri Mar 22 21:44:06 2019 +0300
@@ -64,13 +64,10 @@
                 }
                 WindowEvent::MouseInput { button, state, .. } => {
                     if let MouseButton::Right = button {
-                        if let ElementState::Pressed = state {
-                            dragging = true;
-                        } else {
-                            dragging = false;
-                        }
+                        dragging = state == ElementState::Pressed;
                     }
                 }
+
                 WindowEvent::MouseWheel { delta, .. } => {
                     let zoom_change = match delta {
                         MouseScrollDelta::LineDelta(x, y) => y as f32 * 0.1f32,