From 2dd7af43a7d8c02eb0c397bd050f7dfbdfa929f0 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Sat, 16 Nov 2024 14:35:29 +0100 Subject: [PATCH] Fix clippy warnings (#116) --- lib/macro/internal/src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/macro/internal/src/lib.rs b/lib/macro/internal/src/lib.rs index bb1ff33..4e0e6c3 100644 --- a/lib/macro/internal/src/lib.rs +++ b/lib/macro/internal/src/lib.rs @@ -67,10 +67,7 @@ fn get_usize(map: &mut HashMap, key: &str) -> usize { } fn get_padding(map: &mut HashMap) -> Option { - let node = match map.remove("padding") { - None => return None, - Some(node) => node, - }; + let node = map.remove("padding")?; if let Ok(result) = syn::parse::(node.clone().into()) { return Some(result.value()); } @@ -81,10 +78,7 @@ fn get_padding(map: &mut HashMap) -> Option { } fn get_bool(map: &mut HashMap, key: &str) -> Option { - let node = match map.remove(key) { - None => return None, - Some(node) => node, - }; + let node = map.remove(key)?; match syn::parse::(node.into()) { Ok(result) => Some(result.value), _ => panic!("expected bool for {}", key),