Implement all of VacantEntry

This commit is contained in:
Gwilym Kuiper 2022-03-20 15:14:44 +00:00
parent 6bc3816b29
commit 2b75ce6cbd

View file

@ -198,6 +198,14 @@ pub struct VacantEntry<'a, K: 'a, V: 'a> {
} }
impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> { impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
pub fn key(&self) -> &K {
&self.key
}
pub fn into_key(self) -> K {
self.key
}
pub fn insert(self, value: V) -> &'a mut V pub fn insert(self, value: V) -> &'a mut V
where where
K: Hash + Eq, K: Hash + Eq,