Skip to content

Commit

Permalink
Fix clippy::unneeded_struct_pattern lints (#7136)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Feb 14, 2025
1 parent ab38df2 commit bae0e70
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions naga/src/back/continue_forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl ContinueCtx {
// forward continue statements within this `Switch`. We can leave
// the stack empty.
None => None,
Some(&Nesting::Loop { .. }) => {
Some(&Nesting::Loop) => {
let variable = Rc::new(namer.call("should_continue"));
self.stack.push(Nesting::Switch {
variable: Rc::clone(&variable),
Expand Down Expand Up @@ -253,7 +253,7 @@ impl ContinueCtx {
// This doesn't indicate a problem: we don't start pushing entries
// for `Switch` statements unless we have an enclosing `Loop`.
None => ExitControlFlow::None,
Some(Nesting::Loop { .. }) => {
Some(Nesting::Loop) => {
unreachable!("Unexpected loop state when exiting switch");
}
Some(Nesting::Switch {
Expand Down
2 changes: 1 addition & 1 deletion naga/src/back/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl crate::TypeInner {
match *self {
crate::TypeInner::Image { .. }
| crate::TypeInner::Sampler { .. }
| crate::TypeInner::AccelerationStructure { .. } => true,
| crate::TypeInner::AccelerationStructure => true,
_ => false,
}
}
Expand Down
4 changes: 2 additions & 2 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5286,13 +5286,13 @@ template <typename A>
LocationMode::VertexOutput,
true,
),
crate::ShaderStage::Fragment { .. } => (
crate::ShaderStage::Fragment => (
"fragment",
LocationMode::FragmentInput,
LocationMode::FragmentOutput,
false,
),
crate::ShaderStage::Compute { .. } => (
crate::ShaderStage::Compute => (
"kernel",
LocationMode::Uniform,
LocationMode::Uniform,
Expand Down
4 changes: 1 addition & 3 deletions naga/src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,7 @@ impl<'a> ConstantEvaluator<'a> {
Expression::RayQueryProceedResult | Expression::RayQueryGetIntersection { .. } => {
Err(ConstantEvaluatorError::RayQueryExpression)
}
Expression::SubgroupBallotResult { .. } => {
Err(ConstantEvaluatorError::SubgroupExpression)
}
Expression::SubgroupBallotResult => Err(ConstantEvaluatorError::SubgroupExpression),
Expression::SubgroupOperationResult { .. } => {
Err(ConstantEvaluatorError::SubgroupExpression)
}
Expand Down
2 changes: 1 addition & 1 deletion naga/tests/wgsl_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ fn invalid_functions() {
Err(naga::valid::ValidationError::Type {
source: naga::valid::TypeError::InvalidPointerToUnsized {
base: _,
space: naga::AddressSpace::WorkGroup { .. },
space: naga::AddressSpace::WorkGroup,
},
..
})
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl From<&ResourceType> for BindingTypeName {
ResourceType::Buffer { .. } => BindingTypeName::Buffer,
ResourceType::Texture { .. } => BindingTypeName::Texture,
ResourceType::Sampler { .. } => BindingTypeName::Sampler,
ResourceType::AccelerationStructure { .. } => BindingTypeName::AccelerationStructure,
ResourceType::AccelerationStructure => BindingTypeName::AccelerationStructure,
}
}
}
Expand All @@ -47,7 +47,7 @@ impl From<&BindingType> for BindingTypeName {
BindingType::Texture { .. } => BindingTypeName::Texture,
BindingType::StorageTexture { .. } => BindingTypeName::Texture,
BindingType::Sampler { .. } => BindingTypeName::Sampler,
BindingType::AccelerationStructure { .. } => BindingTypeName::AccelerationStructure,
BindingType::AccelerationStructure => BindingTypeName::AccelerationStructure,
}
}
}
Expand Down

0 comments on commit bae0e70

Please sign in to comment.