From 72bb53b0ed9c49b49f71d738cfe3acc982ce7ab0 Mon Sep 17 00:00:00 2001 From: Luo Zhihao Date: Thu, 7 May 2026 04:19:14 +0800 Subject: [PATCH] Change `map_label_and_view_formats` to take `view_formats` by reference (#9481) --- wgpu-types/src/texture.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wgpu-types/src/texture.rs b/wgpu-types/src/texture.rs index ae8e44848..1813dcb4f 100644 --- a/wgpu-types/src/texture.rs +++ b/wgpu-types/src/texture.rs @@ -531,11 +531,8 @@ impl TextureDescriptor { pub fn map_label_and_view_formats( &self, l_fun: impl FnOnce(&L) -> K, - v_fun: impl FnOnce(V) -> M, - ) -> TextureDescriptor - where - V: Clone, - { + v_fun: impl FnOnce(&V) -> M, + ) -> TextureDescriptor { TextureDescriptor { label: l_fun(&self.label), size: self.size, @@ -544,7 +541,7 @@ impl TextureDescriptor { dimension: self.dimension, format: self.format, usage: self.usage, - view_formats: v_fun(self.view_formats.clone()), + view_formats: v_fun(&self.view_formats), } }