Appease clippy by using matches!() where appropriate

This commit is contained in:
Steve Wooster 2020-10-16 21:55:41 -07:00 committed by Benjamin Saunders
parent 5d5fc57746
commit ef8b5490c5

View file

@ -575,9 +575,11 @@ impl CommandExt for vkxml::Command {
let is_first_param_device = self let is_first_param_device = self
.param .param
.get(0) .get(0)
.map(|field| match field.basetype.as_str() { .map(|field| {
"VkDevice" | "VkCommandBuffer" | "VkQueue" => true, matches!(
_ => false, field.basetype.as_str(),
"VkDevice" | "VkCommandBuffer" | "VkQueue"
)
}) })
.unwrap_or(false); .unwrap_or(false);
match self.name.as_str() { match self.name.as_str() {
@ -1426,10 +1428,7 @@ fn is_static_array(field: &vkxml::Field) -> bool {
field field
.array .array
.as_ref() .as_ref()
.map(|ty| match ty { .map(|ty| matches!(ty, vkxml::ArrayType::Static))
vkxml::ArrayType::Static => true,
_ => false,
})
.unwrap_or(false) .unwrap_or(false)
} }
pub fn derive_default(_struct: &vkxml::Struct) -> Option<Tokens> { pub fn derive_default(_struct: &vkxml::Struct) -> Option<Tokens> {