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
parent 01aa6af1fd
commit 8db11cce37
4 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,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

@ -320,7 +320,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