Skip to content

Commit b5973ab

Browse files
chore: satisfy clippy::collapsible_match
1 parent 9dea058 commit b5973ab

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

naga/src/back/glsl/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,14 +1313,13 @@ impl<'a, W: Write> Writer<'a, W> {
13131313
crate::MathFunction::Dot => {
13141314
// if the expression is a Dot product with integer arguments,
13151315
// then the args needs baking as well
1316-
if let TypeInner::Scalar(crate::Scalar { kind, .. }) = *inner {
1317-
match kind {
1318-
crate::ScalarKind::Sint | crate::ScalarKind::Uint => {
1319-
self.need_bake_expressions.insert(arg);
1320-
self.need_bake_expressions.insert(arg1.unwrap());
1321-
}
1322-
_ => {}
1323-
}
1316+
if let TypeInner::Scalar(crate::Scalar {
1317+
kind: crate::ScalarKind::Sint | crate::ScalarKind::Uint,
1318+
..
1319+
}) = *inner
1320+
{
1321+
self.need_bake_expressions.insert(arg);
1322+
self.need_bake_expressions.insert(arg1.unwrap());
13241323
}
13251324
}
13261325
crate::MathFunction::Pack4xI8

naga/src/valid/analyzer.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,15 +593,14 @@ impl FunctionInfo {
593593
E::FunctionArgument(index) => {
594594
let arg = &resolve_context.arguments[index as usize];
595595
let uniform = match arg.binding {
596-
Some(crate::Binding::BuiltIn(built_in)) => match built_in {
596+
Some(crate::Binding::BuiltIn(
597597
// per-polygon built-ins are uniform
598598
crate::BuiltIn::FrontFacing
599599
// per-work-group built-ins are uniform
600600
| crate::BuiltIn::WorkGroupId
601601
| crate::BuiltIn::WorkGroupSize
602-
| crate::BuiltIn::NumWorkGroups => true,
603-
_ => false,
604-
},
602+
| crate::BuiltIn::NumWorkGroups)
603+
) => true,
605604
// only flat inputs are uniform
606605
Some(crate::Binding::Location {
607606
interpolation: Some(crate::Interpolation::Flat),

naga/src/valid/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,14 +533,13 @@ impl Validator {
533533

534534
let decl_ty = &gctx.types[o.ty].inner;
535535
match decl_ty {
536-
&crate::TypeInner::Scalar(scalar) => match scalar {
536+
&crate::TypeInner::Scalar(
537537
crate::Scalar::BOOL
538538
| crate::Scalar::I32
539539
| crate::Scalar::U32
540540
| crate::Scalar::F32
541-
| crate::Scalar::F64 => {}
542-
_ => return Err(OverrideError::TypeNotScalar),
543-
},
541+
| crate::Scalar::F64,
542+
) => {}
544543
_ => return Err(OverrideError::TypeNotScalar),
545544
}
546545

wgpu-hal/examples/raw-gles.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,19 @@ fn main() {
4949

5050
match event {
5151
Event::LoopDestroyed => (),
52-
Event::WindowEvent { event, .. } => match event {
53-
WindowEvent::CloseRequested
54-
| WindowEvent::KeyboardInput {
55-
input:
56-
KeyboardInput {
57-
virtual_keycode: Some(VirtualKeyCode::Escape),
58-
..
59-
},
60-
..
61-
} => *control_flow = ControlFlow::Exit,
62-
_ => (),
63-
},
52+
Event::WindowEvent {
53+
event:
54+
WindowEvent::CloseRequested
55+
| WindowEvent::KeyboardInput {
56+
input:
57+
KeyboardInput {
58+
virtual_keycode: Some(VirtualKeyCode::Escape),
59+
..
60+
},
61+
..
62+
},
63+
..
64+
} => *control_flow = ControlFlow::Exit,
6465
_ => (),
6566
}
6667
});

0 commit comments

Comments
 (0)