From ede9c1b4597d23324d81602ed99ed8a41923be9e Mon Sep 17 00:00:00 2001 From: John Wells Date: Tue, 13 Feb 2024 12:24:35 -0500 Subject: [PATCH] Remove allow(clippy::match_ref_pats) --- src/driver/accel_struct.rs | 16 ++++++++-------- src/driver/shader.rs | 22 +++++++++++----------- src/lib.rs | 2 -- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/driver/accel_struct.rs b/src/driver/accel_struct.rs index c103bed..5e0242c 100644 --- a/src/driver/accel_struct.rs +++ b/src/driver/accel_struct.rs @@ -293,8 +293,8 @@ impl AccelerationStructure { for info in info.geometries.iter() { let flags = info.flags; - let (geometry_type, geometry) = match &info.geometry { - &AccelerationStructureGeometryData::AABBs { stride } => ( + let (geometry_type, geometry) = match info.geometry { + AccelerationStructureGeometryData::AABBs { stride } => ( vk::GeometryTypeKHR::AABBS, vk::AccelerationStructureGeometryDataKHR { aabbs: vk::AccelerationStructureGeometryAabbsDataKHR { @@ -303,7 +303,7 @@ impl AccelerationStructure { }, }, ), - &AccelerationStructureGeometryData::Instances { + AccelerationStructureGeometryData::Instances { array_of_pointers, .. } => ( vk::GeometryTypeKHR::INSTANCES, @@ -314,7 +314,7 @@ impl AccelerationStructure { }, }, ), - &AccelerationStructureGeometryData::Triangles { + AccelerationStructureGeometryData::Triangles { index_type, max_vertex, transform_data, @@ -424,8 +424,8 @@ pub struct AccelerationStructureGeometry { impl AccelerationStructureGeometry { pub(crate) fn into_vk(self) -> vk::AccelerationStructureGeometryKHR { - let (geometry_type, geometry) = match &self.geometry { - &AccelerationStructureGeometryData::AABBs { stride } => ( + let (geometry_type, geometry) = match self.geometry { + AccelerationStructureGeometryData::AABBs { stride } => ( vk::GeometryTypeKHR::AABBS, vk::AccelerationStructureGeometryDataKHR { aabbs: vk::AccelerationStructureGeometryAabbsDataKHR { @@ -434,7 +434,7 @@ impl AccelerationStructureGeometry { }, }, ), - &AccelerationStructureGeometryData::Instances { + AccelerationStructureGeometryData::Instances { array_of_pointers, data, } => ( @@ -452,7 +452,7 @@ impl AccelerationStructureGeometry { }, }, ), - &AccelerationStructureGeometryData::Triangles { + AccelerationStructureGeometryData::Triangles { index_data, index_type, max_vertex, diff --git a/src/driver/shader.rs b/src/driver/shader.rs index da4ca81..544e0f2 100644 --- a/src/driver/shader.rs +++ b/src/driver/shader.rs @@ -115,17 +115,17 @@ pub(crate) enum DescriptorInfo { impl DescriptorInfo { pub fn binding_count(&self) -> u32 { - match self { - &Self::AccelerationStructure(binding_count) => binding_count, - &Self::CombinedImageSampler(binding_count, ..) => binding_count, - &Self::InputAttachment(binding_count, _) => binding_count, - &Self::SampledImage(binding_count) => binding_count, - &Self::Sampler(binding_count) => binding_count, - &Self::StorageBuffer(binding_count) => binding_count, - &Self::StorageImage(binding_count) => binding_count, - &Self::StorageTexelBuffer(binding_count) => binding_count, - &Self::UniformBuffer(binding_count) => binding_count, - &Self::UniformTexelBuffer(binding_count) => binding_count, + match *self { + Self::AccelerationStructure(binding_count) => binding_count, + Self::CombinedImageSampler(binding_count, ..) => binding_count, + Self::InputAttachment(binding_count, _) => binding_count, + Self::SampledImage(binding_count) => binding_count, + Self::Sampler(binding_count) => binding_count, + Self::StorageBuffer(binding_count) => binding_count, + Self::StorageImage(binding_count) => binding_count, + Self::StorageTexelBuffer(binding_count) => binding_count, + Self::UniformBuffer(binding_count) => binding_count, + Self::UniformTexelBuffer(binding_count) => binding_count, } } diff --git a/src/lib.rs b/src/lib.rs index e7b3f9b..a643a19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -318,8 +318,6 @@ layout. */ -// HACK: I'm having trouble supressing the lint at src/graph/mod.rs:650 -#![allow(clippy::match_ref_pats)] #![warn(missing_docs)] pub mod driver;