Skip to content

Commit

Permalink
Remove allow(clippy::match_ref_pats)
Browse files Browse the repository at this point in the history
  • Loading branch information
attackgoat committed Feb 13, 2024
1 parent 8a5853e commit ede9c1b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
16 changes: 8 additions & 8 deletions src/driver/accel_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -303,7 +303,7 @@ impl AccelerationStructure {
},
},
),
&AccelerationStructureGeometryData::Instances {
AccelerationStructureGeometryData::Instances {
array_of_pointers, ..
} => (
vk::GeometryTypeKHR::INSTANCES,
Expand All @@ -314,7 +314,7 @@ impl AccelerationStructure {
},
},
),
&AccelerationStructureGeometryData::Triangles {
AccelerationStructureGeometryData::Triangles {
index_type,
max_vertex,
transform_data,
Expand Down Expand Up @@ -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 {
Expand All @@ -434,7 +434,7 @@ impl AccelerationStructureGeometry {
},
},
),
&AccelerationStructureGeometryData::Instances {
AccelerationStructureGeometryData::Instances {
array_of_pointers,
data,
} => (
Expand All @@ -452,7 +452,7 @@ impl AccelerationStructureGeometry {
},
},
),
&AccelerationStructureGeometryData::Triangles {
AccelerationStructureGeometryData::Triangles {
index_data,
index_type,
max_vertex,
Expand Down
22 changes: 11 additions & 11 deletions src/driver/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ede9c1b

Please sign in to comment.