From b3e56e88f2d13b3efed3ac66f51344a9264483c8 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 9 May 2023 21:39:35 +0100 Subject: [PATCH] Use ? rather than if let --- agb-hashmap/src/node_storage.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/agb-hashmap/src/node_storage.rs b/agb-hashmap/src/node_storage.rs index ed21ddf2..011694f0 100644 --- a/agb-hashmap/src/node_storage.rs +++ b/agb-hashmap/src/node_storage.rs @@ -146,12 +146,10 @@ impl NodeStorage { ); let node = &self.nodes[location]; - if let Some(node_key_ref) = node.key_ref() { - if node_key_ref.borrow() == key { - return Some(location); - } - } else { - return None; + let node_key_ref = node.key_ref()?; + + if node_key_ref.borrow() == key { + return Some(location); } }