Change map_label_and_view_formats to take view_formats by reference (#9481)

This commit is contained in:
Luo Zhihao authored and GitHub committed 2026-05-06 13:19:14 -07:00
1 parent 82fdc4e5ca
commit 72bb53b0ed
1 file changed
+3 -6
+3 -6
View File
@@ -531,11 +531,8 @@ impl<L, V> TextureDescriptor<L, V> {
pub fn map_label_and_view_formats<K, M>(
&self,
l_fun: impl FnOnce(&L) -> K,
v_fun: impl FnOnce(V) -> M,
) -> TextureDescriptor<K, M>
where
V: Clone,
{
v_fun: impl FnOnce(&V) -> M,
) -> TextureDescriptor<K, M> {
TextureDescriptor {
label: l_fun(&self.label),
size: self.size,
@@ -544,7 +541,7 @@ impl<L, V> TextureDescriptor<L, V> {
dimension: self.dimension,
format: self.format,
usage: self.usage,
view_formats: v_fun(self.view_formats.clone()),
view_formats: v_fun(&self.view_formats),
}
}