From e68a4d373f4cdeac067466cd478e3c16aa138b76 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 19 Mar 2022 23:10:12 +0000 Subject: [PATCH] Replace .map().flatten() with .and_then() --- agb/src/hash_map.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index 655aa1b8..30028c04 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -314,8 +314,7 @@ where self.nodes .get_location(key, hash) - .map(|location| self.nodes.nodes[location].get_value_ref()) - .flatten() + .and_then(|location| self.nodes.nodes[location].get_value_ref()) } pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {