From 73834e40139729a5c14d9bcb17a9280a7c211529 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Fri, 14 Apr 2023 13:26:15 +0200 Subject: [PATCH] Use iterator for pool sizes --- vulkan-rs/src/descriptorsetlayout.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vulkan-rs/src/descriptorsetlayout.rs b/vulkan-rs/src/descriptorsetlayout.rs index 0535cfe..a771a46 100644 --- a/vulkan-rs/src/descriptorsetlayout.rs +++ b/vulkan-rs/src/descriptorsetlayout.rs @@ -72,14 +72,14 @@ impl DescriptorSetLayoutBuilder { let descriptor_set_layout = device.create_descriptor_set_layout(&descriptor_set_ci)?; - let mut pool_sizes = Vec::new(); - - for layout_binding in &self.layout_bindings { - pool_sizes.push(VkDescriptorPoolSize { + let pool_sizes = self + .layout_bindings + .into_iter() + .map(|layout_binding| VkDescriptorPoolSize { ty: layout_binding.descriptorType, descriptorCount: layout_binding.descriptorCount, - }); - } + }) + .collect(); Ok(Arc::new(DescriptorSetLayout { device,