From 0ed35d3ef4111455c24d01d38c3e054e29f4ba96 Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Sun, 7 Jul 2019 04:37:22 +0000 Subject: [PATCH] Fix rustc warning --- voxygen/src/session.rs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 1552edce71..a0b756cd2d 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -176,22 +176,14 @@ impl PlayState for SessionState { let cam_dir = (self.scene.camera().get_focus_pos() - cam_pos).normalized(); - let (d, block) = { - let terrain = client.state().terrain(); - let ray = - terrain.ray(cam_pos, cam_pos + cam_dir * 100.0).cast(); - ( - ray.0, - if let Ok(Some(b)) = ray.1 { - Some(*b) - } else { - None - }, - ) - }; - - if let Some(block) = block { - self.selected_block = block; + if let Ok(Some(block)) = client + .state() + .terrain() + .ray(cam_pos, cam_pos + cam_dir * 100.0) + .cast() + .1 + { + self.selected_block = *block; } } } else {