From e6e9368082f87fa71ea7eaf9f7c498d38c3af3f5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 22 Aug 2022 18:15:08 +0200 Subject: [PATCH] Use `matches!` macro to determine if `CardCode::is_valid` --- src/data/setbundle/code.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/data/setbundle/code.rs b/src/data/setbundle/code.rs index bd00b7b..5a78438 100644 --- a/src/data/setbundle/code.rs +++ b/src/data/setbundle/code.rs @@ -38,11 +38,7 @@ impl CardCode { pub fn is_valid(&self) -> bool { let is_ascii = self.full.is_ascii(); - let is_long = match self.full.len() { - 7 => true, - 9 => true, - _ => false, - }; + let is_long = matches!(self.full.len(), 7 | 9); is_ascii && is_long }