Replace .map().flatten() with .and_then()

This commit is contained in:
Gwilym Kuiper 2022-03-19 23:10:12 +00:00
parent 280e7f876d
commit e68a4d373f

View file

@ -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> {