@@ -445,6 +445,9 @@ pub enum Entry<'a, K, V> {
445445}
446446
447447impl < ' a , K , V > Entry < ' a , K , V > {
448+ /// Inserts the given default value in the entry if it is vacant and returns a mutable
449+ /// reference to it. Otherwise a mutable reference to an already existent value is returned.
450+ ///
448451 /// Computes in **O(1)** time (amortized average).
449452 pub fn or_insert ( self , default : V ) -> & ' a mut V {
450453 match self {
@@ -453,6 +456,9 @@ impl<'a, K, V> Entry<'a, K, V> {
453456 }
454457 }
455458
459+ /// Inserts the result of the `call` function in the entry if it is vacant and returns a mutable
460+ /// reference to it. Otherwise a mutable reference to an already existent value is returned.
461+ ///
456462 /// Computes in **O(1)** time (amortized average).
457463 pub fn or_insert_with < F > ( self , call : F ) -> & ' a mut V
458464 where
@@ -590,6 +596,7 @@ impl<'a, K, V> VacantEntry<'a, K, V> {
590596 & self . key
591597 }
592598
599+ /// Takes ownership of the key, leaving the entry vacant.
593600 pub fn into_key ( self ) -> K {
594601 self . key
595602 }
@@ -599,6 +606,8 @@ impl<'a, K, V> VacantEntry<'a, K, V> {
599606 self . map . len ( )
600607 }
601608
609+ /// Inserts the entry's key and the given value into the map, and returns a mutable reference
610+ /// to the value.
602611 pub fn insert ( self , value : V ) -> & ' a mut V {
603612 let i = self . map . push ( self . hash , self . key , value) ;
604613 & mut self . map . entries [ i] . value
0 commit comments