Turn consecutive if-lets into pattern match

This commit is contained in:
Héctor Ramón Jiménez 2020-08-27 19:40:42 +02:00
parent 7559e4fb30
commit 07880c392c
1 changed files with 6 additions and 6 deletions

View File

@ -272,12 +272,11 @@ impl Pipeline {
let vertices = bytemuck::cast_slice(&mesh.buffers.vertices); let vertices = bytemuck::cast_slice(&mesh.buffers.vertices);
let indices = bytemuck::cast_slice(&mesh.buffers.indices); let indices = bytemuck::cast_slice(&mesh.buffers.indices);
if let Some(vertices_size) = match (
wgpu::BufferSize::new(vertices.len() as u64) wgpu::BufferSize::new(vertices.len() as u64),
{ wgpu::BufferSize::new(indices.len() as u64),
if let Some(indices_size) = ) {
wgpu::BufferSize::new(indices.len() as u64) (Some(vertices_size), Some(indices_size)) => {
{
{ {
let mut vertex_buffer = staging_belt.write_buffer( let mut vertex_buffer = staging_belt.write_buffer(
encoder, encoder,
@ -313,6 +312,7 @@ impl Pipeline {
last_vertex += mesh.buffers.vertices.len(); last_vertex += mesh.buffers.vertices.len();
last_index += mesh.buffers.indices.len(); last_index += mesh.buffers.indices.len();
} }
_ => {}
} }
} }