From ef8b5490c59dc909d4dfd8676e2e1375521652d8 Mon Sep 17 00:00:00 2001 From: Steve Wooster Date: Fri, 16 Oct 2020 21:55:41 -0700 Subject: [PATCH] Appease clippy by using matches!() where appropriate --- generator/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/generator/src/lib.rs b/generator/src/lib.rs index c36cbbe..c9f972e 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -575,9 +575,11 @@ impl CommandExt for vkxml::Command { let is_first_param_device = self .param .get(0) - .map(|field| match field.basetype.as_str() { - "VkDevice" | "VkCommandBuffer" | "VkQueue" => true, - _ => false, + .map(|field| { + matches!( + field.basetype.as_str(), + "VkDevice" | "VkCommandBuffer" | "VkQueue" + ) }) .unwrap_or(false); match self.name.as_str() { @@ -1426,10 +1428,7 @@ fn is_static_array(field: &vkxml::Field) -> bool { field .array .as_ref() - .map(|ty| match ty { - vkxml::ArrayType::Static => true, - _ => false, - }) + .map(|ty| matches!(ty, vkxml::ArrayType::Static)) .unwrap_or(false) } pub fn derive_default(_struct: &vkxml::Struct) -> Option {