From da86b3f401a4b2fbe3184a87c2a7551d351cb011 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Sat, 30 Jan 2021 09:59:51 +0100 Subject: [PATCH] Cleanup, better use of some rust std lib functions --- wgpu-core/src/command/bundle.rs | 3 +-- wgpu-core/src/command/compute.rs | 2 +- wgpu-core/src/command/render.rs | 4 ++-- wgpu-core/src/device/mod.rs | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index da37e1b447..9f847d86cd 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -206,8 +206,7 @@ impl RenderBundleEncoder { .map_pass_err(scope); } - buffer_memory_init_actions - .extend(bind_group.used_buffer_ranges.iter().map(|x| x.clone())); + buffer_memory_init_actions.extend_from_slice(&bind_group.used_buffer_ranges); state.set_bind_group(index, bind_group_id, bind_group.layout_id, offsets); state diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index e9158d4c1a..bd83217673 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -342,7 +342,7 @@ impl Global { } Err(_) => false, }) - .map(|action| action.clone()), + .cloned(), ); if let Some((pipeline_layout_id, follow_ups)) = state.binder.provide_entry( diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 20ed60a15c..32351b4aa1 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1128,7 +1128,7 @@ impl Global { } Err(_) => false, }) - .map(|action| action.clone()), + .cloned(), ); if let Some((pipeline_layout_id, follow_ups)) = state.binder.provide_entry( @@ -1897,7 +1897,7 @@ impl Global { } Err(_) => false, }) - .map(|action| action.clone()), + .cloned(), ); unsafe { diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index c2cf35b0b3..964b64e223 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -9,7 +9,7 @@ use crate::{ GfxBackend, Global, GlobalIdentityHandlerFactory, Hub, Input, InvalidId, Storage, Token, }, id, instance, - memory_init_tracker::*, + memory_init_tracker::{MemoryInitKind, MemoryInitTracker, MemoryInitTrackerAction}, pipeline, resource, span, swap_chain, track::{BufferState, TextureSelector, TextureState, TrackerSet}, validation::{self, check_buffer_usage, check_texture_usage},