diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index b71f051e3cc..0bb7adc75e0 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -762,8 +762,8 @@ impl crate::Surface for Surface { }; match &self.target { - &SurfaceTarget::WndHandle(_) | &SurfaceTarget::SurfaceHandle(_) => {} - &SurfaceTarget::Visual(ref visual) => { + SurfaceTarget::WndHandle(_) | &SurfaceTarget::SurfaceHandle(_) => {} + SurfaceTarget::Visual(visual) => { if let Err(err) = unsafe { visual.SetContent(swap_chain1.as_unknown()) }.into_result() { @@ -773,7 +773,7 @@ impl crate::Surface for Surface { )); } } - &SurfaceTarget::SwapChainPanel(ref swap_chain_panel) => { + SurfaceTarget::SwapChainPanel(swap_chain_panel) => { if let Err(err) = unsafe { swap_chain_panel.SetSwapChain(swap_chain1.as_ptr()) } .into_result() diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index 8af2e3a84b4..27854ebfc7b 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -227,8 +227,8 @@ clippy::non_send_fields_in_send_ty, // TODO! clippy::missing_safety_doc, - // Clashes with clippy::pattern_type_mismatch - clippy::needless_borrowed_reference, + // It gets in the way a lot and does not prevent bugs in practice. + clippy::pattern_type_mismatch, )] #![warn( trivial_casts, @@ -236,8 +236,6 @@ unsafe_op_in_unsafe_fn, unused_extern_crates, unused_qualifications, - // We don't match on a reference, unless required. - clippy::pattern_type_mismatch, )] /// DirectX12 API internals. diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index 6d32b864a7a..6af82e1e625 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -1342,7 +1342,7 @@ impl crate::Device for super::Device { .iter() .find(|&&(value, _)| value >= wait_value) { - Some(&(_, ref cmd_buf)) => cmd_buf, + Some((_, cmd_buf)) => cmd_buf, None => { log::error!("No active command buffers for fence value {}", wait_value); return Err(crate::DeviceError::Lost);