Fix a clippy warning about superfluous match references
authorBernie Innocenti <bernie@codewiz.org>
Mon, 1 Mar 2021 07:50:31 +0000 (14:50 +0700)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 1 Mar 2021 07:50:31 +0000 (14:50 +0700)
See: https://rust-lang.github.io/rust-clippy/master/#match_ref_pats

support/camera.rs

index db6c55ac6b103723999c7efd959ed1650cd91ce3..25b1e7292b9fb54b92c0bcdb775e052e9f437074 100644 (file)
@@ -166,7 +166,7 @@ impl CameraState {
     pub fn process_input(&mut self, event: &WindowEvent) {
         //println!("camera event={:?}", event);
         match event {
-            &WindowEvent::CursorMoved { position, .. }  => {
+            WindowEvent::CursorMoved { position, .. }  => {
                 let (x, y) = (position.x as i32, position.y as i32);
                 if self.mouse_x == -1 {
                     // Set initial absolute position.
@@ -178,7 +178,7 @@ impl CameraState {
                 self.mouse_x = x;
                 self.mouse_y = y;
             }
-            &WindowEvent::KeyboardInput { input, .. } => {
+            WindowEvent::KeyboardInput { input, .. } => {
                 let pressed = input.state == ElementState::Pressed;
                 let key = match input.virtual_keycode {
                     Some(key) => key,