Use expect to document potential panic when starting a new frame recording, fix clippy warning

This commit is contained in:
Imbris 2021-05-13 02:34:15 -04:00 committed by Avi Weinstock
parent 77d4ea9703
commit 3c86d49f5b
4 changed files with 4 additions and 4 deletions

View File

@ -231,7 +231,7 @@ impl PlayState for CharSelectionState {
fn render(&mut self, renderer: &mut Renderer, _: &Settings) { fn render(&mut self, renderer: &mut Renderer, _: &Settings) {
let mut drawer = match renderer let mut drawer = match renderer
.start_recording_frame(self.scene.global_bind_group()) .start_recording_frame(self.scene.global_bind_group())
.unwrap() .expect("Unrecoverable render error when starting a new frame!")
{ {
Some(d) => d, Some(d) => d,
// Couldn't get swap chain texture this fime // Couldn't get swap chain texture this fime

View File

@ -417,7 +417,7 @@ impl PlayState for MainMenuState {
fn render(&mut self, renderer: &mut Renderer, _: &Settings) { fn render(&mut self, renderer: &mut Renderer, _: &Settings) {
let mut drawer = match renderer let mut drawer = match renderer
.start_recording_frame(self.scene.global_bind_group()) .start_recording_frame(self.scene.global_bind_group())
.unwrap() .expect("Unrecoverable render error when starting a new frame!")
{ {
Some(d) => d, Some(d) => d,
// Couldn't get swap chain texture this frame // Couldn't get swap chain texture this frame

View File

@ -1123,7 +1123,7 @@ impl<V: RectRasterableVol> Terrain<V> {
renderer.update_texture( renderer.update_texture(
&col_lights.texture, &col_lights.texture,
atlas_offs.into_array(), atlas_offs.into_array(),
tex_size.map(|e| u32::from(e)).into_array(), tex_size.map(u32::from).into_array(),
&tex, &tex,
); );

View File

@ -1394,7 +1394,7 @@ impl PlayState for SessionState {
span!(_guard, "render", "<Session as PlayState>::render"); span!(_guard, "render", "<Session as PlayState>::render");
let mut drawer = match renderer let mut drawer = match renderer
.start_recording_frame(self.scene.global_bind_group()) .start_recording_frame(self.scene.global_bind_group())
.unwrap() .expect("Unrecoverable render error when starting a new frame!")
{ {
Some(d) => d, Some(d) => d,
// Couldn't get swap chain texture this frame // Couldn't get swap chain texture this frame