From 3c86d49f5b635e28bf003033442108ab96b45bd5 Mon Sep 17 00:00:00 2001 From: Imbris Date: Thu, 13 May 2021 02:34:15 -0400 Subject: [PATCH] Use expect to document potential panic when starting a new frame recording, fix clippy warning --- voxygen/src/menu/char_selection/mod.rs | 2 +- voxygen/src/menu/main/mod.rs | 2 +- voxygen/src/scene/terrain.rs | 2 +- voxygen/src/session/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 90ed288483..2f714d7a02 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -231,7 +231,7 @@ impl PlayState for CharSelectionState { fn render(&mut self, renderer: &mut Renderer, _: &Settings) { let mut drawer = match renderer .start_recording_frame(self.scene.global_bind_group()) - .unwrap() + .expect("Unrecoverable render error when starting a new frame!") { Some(d) => d, // Couldn't get swap chain texture this fime diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index a3428e4720..3fe84f7c3a 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -417,7 +417,7 @@ impl PlayState for MainMenuState { fn render(&mut self, renderer: &mut Renderer, _: &Settings) { let mut drawer = match renderer .start_recording_frame(self.scene.global_bind_group()) - .unwrap() + .expect("Unrecoverable render error when starting a new frame!") { Some(d) => d, // Couldn't get swap chain texture this frame diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index b6574919d3..713d9e0156 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -1123,7 +1123,7 @@ impl Terrain { renderer.update_texture( &col_lights.texture, atlas_offs.into_array(), - tex_size.map(|e| u32::from(e)).into_array(), + tex_size.map(u32::from).into_array(), &tex, ); diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 5e2311464b..4cf91a6171 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -1394,7 +1394,7 @@ impl PlayState for SessionState { span!(_guard, "render", "::render"); let mut drawer = match renderer .start_recording_frame(self.scene.global_bind_group()) - .unwrap() + .expect("Unrecoverable render error when starting a new frame!") { Some(d) => d, // Couldn't get swap chain texture this frame