From b4abd656599b3fdd704e915fb6079620f28a26bf Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 26 May 2024 13:37:53 +0700 Subject: [PATCH] chore: Fix more `unused_qualifications` (#5746) --- wgpu-hal/src/gles/egl.rs | 14 ++++++-------- wgpu-hal/src/metal/adapter.rs | 8 +++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index 00ef70ba88..5ddf9b48b5 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -1226,17 +1226,15 @@ impl crate::Surface for Surface { let native_window_ptr = match (self.wsi.kind, self.raw_window_handle) { (WindowKind::Unknown | WindowKind::X11, Rwh::Xlib(handle)) => { temp_xlib_handle = handle.window; - &mut temp_xlib_handle as *mut _ as *mut std::ffi::c_void - } - (WindowKind::AngleX11, Rwh::Xlib(handle)) => { - handle.window as *mut std::ffi::c_void + &mut temp_xlib_handle as *mut _ as *mut ffi::c_void } + (WindowKind::AngleX11, Rwh::Xlib(handle)) => handle.window as *mut ffi::c_void, (WindowKind::Unknown | WindowKind::X11, Rwh::Xcb(handle)) => { temp_xcb_handle = handle.window; - &mut temp_xcb_handle as *mut _ as *mut std::ffi::c_void + &mut temp_xcb_handle as *mut _ as *mut ffi::c_void } (WindowKind::AngleX11, Rwh::Xcb(handle)) => { - handle.window.get() as *mut std::ffi::c_void + handle.window.get() as *mut ffi::c_void } (WindowKind::Unknown, Rwh::AndroidNdk(handle)) => { handle.a_native_window.as_ptr() @@ -1252,9 +1250,9 @@ impl crate::Surface for Surface { window } #[cfg(Emscripten)] - (WindowKind::Unknown, Rwh::Web(handle)) => handle.id as *mut std::ffi::c_void, + (WindowKind::Unknown, Rwh::Web(handle)) => handle.id as *mut ffi::c_void, (WindowKind::Unknown, Rwh::Win32(handle)) => { - handle.hwnd.get() as *mut std::ffi::c_void + handle.hwnd.get() as *mut ffi::c_void } (WindowKind::Unknown, Rwh::AppKit(handle)) => { #[cfg(not(target_os = "macos"))] diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 067303ef7b..2f84be8859 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -82,11 +82,9 @@ impl crate::Adapter for super::Adapter { // https://developer.apple.com/documentation/metal/mtlreadwritetexturetier/mtlreadwritetexturetier1?language=objc // https://developer.apple.com/documentation/metal/mtlreadwritetexturetier/mtlreadwritetexturetier2?language=objc let (read_write_tier1_if, read_write_tier2_if) = match pc.read_write_texture_tier { - metal::MTLReadWriteTextureTier::TierNone => (Tfc::empty(), Tfc::empty()), - metal::MTLReadWriteTextureTier::Tier1 => (Tfc::STORAGE_READ_WRITE, Tfc::empty()), - metal::MTLReadWriteTextureTier::Tier2 => { - (Tfc::STORAGE_READ_WRITE, Tfc::STORAGE_READ_WRITE) - } + MTLReadWriteTextureTier::TierNone => (Tfc::empty(), Tfc::empty()), + MTLReadWriteTextureTier::Tier1 => (Tfc::STORAGE_READ_WRITE, Tfc::empty()), + MTLReadWriteTextureTier::Tier2 => (Tfc::STORAGE_READ_WRITE, Tfc::STORAGE_READ_WRITE), }; let msaa_count = pc.sample_count_mask;