What I would like to do:
hash_map.entry(1).or_insert_with(|| { something().await; return 2; })
What I believe I have to do:
match hash_map.entry(1) {
Entry::Occupied(_) => {...},
Entry::Vacant(entry) => {
something.await;
entry.insert(2);
}
}
Am I right or am I missing something?