From ba537577e8a09e8160fe9c8cb4b75b920c0de157 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Fri, 27 Dec 2024 13:07:32 -0800 Subject: [PATCH] gpu: Fix attempt to use format string in `expect()`. --- all-is-cubes-gpu/src/in_wgpu/init.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/all-is-cubes-gpu/src/in_wgpu/init.rs b/all-is-cubes-gpu/src/in_wgpu/init.rs index 7e76e57f7..8d2656fd4 100644 --- a/all-is-cubes-gpu/src/in_wgpu/init.rs +++ b/all-is-cubes-gpu/src/in_wgpu/init.rs @@ -250,9 +250,10 @@ impl TextureCopyParameters { texture.height(), texture.depth_or_array_layers(), ), - byte_size_of_texel: format - .block_copy_size(None) - .expect("non-color texture format {format:} not supported"), + byte_size_of_texel: match format.block_copy_size(None) { + Some(val) => val, + None => panic!("non-color texture format {format:?} not supported"), + }, } }