[core] Shorten code

parent 079ffc41
Pipeline #100983 passed with stages
in 13 minutes and 7 seconds
......@@ -481,10 +481,10 @@ where
fn insert(value: V, entry: VacantEntry<'a, K, V, H>) -> &'a mut V {
let old_value = entry.base.insert(entry.key.clone(), value);
debug_assert!(old_value.is_none());
match entry.base.entry(entry.key) {
Entry::Vacant(_) => unreachable!("entry was just inserted; qed"),
Entry::Occupied(entry) => entry.into_mut(),
}
entry
.base
.get_mut(&entry.key)
.expect("encountered invalid vacant entry")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment