@@ -664,7 +664,9 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
664
664
replace ( self . get_mut ( ) , value)
665
665
}
666
666
667
- #[ deprecated( note = "use `swap_remove` or `shift_remove`" ) ]
667
+ /// Remove the key, value pair stored in the map for this entry, and return the value.
668
+ ///
669
+ /// **NOTE:** This is equivalent to `.swap_remove()`.
668
670
pub fn remove ( self ) -> V {
669
671
self . swap_remove ( )
670
672
}
@@ -692,7 +694,8 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
692
694
}
693
695
694
696
/// Remove and return the key, value pair stored in the map for this entry
695
- #[ deprecated( note = "use `swap_remove_entry` or `shift_remove_entry`" ) ]
697
+ ///
698
+ /// **NOTE:** This is equivalent to `.swap_remove_entry()`.
696
699
pub fn remove_entry ( self ) -> ( K , V ) {
697
700
self . swap_remove_entry ( )
698
701
}
@@ -998,10 +1001,14 @@ impl<K, V, S> IndexMap<K, V, S>
998
1001
self . core . find_using ( h, move |entry| { Q :: equivalent ( key, & entry. key ) } )
999
1002
}
1000
1003
1001
- /// NOTE: Same as .swap_remove
1004
+ /// Remove the key-value pair equivalent to `key` and return
1005
+ /// its value.
1006
+ ///
1007
+ /// **NOTE:** This is equivalent to `.swap_remove(key)`, if you need to
1008
+ /// preserve the order of the keys in the map, use `.shift_remove(key)`
1009
+ /// instead.
1002
1010
///
1003
1011
/// Computes in **O(1)** time (average).
1004
- #[ deprecated( note = "use `swap_remove`" ) ]
1005
1012
pub fn remove < Q : ?Sized > ( & mut self , key : & Q ) -> Option < V >
1006
1013
where Q : Hash + Equivalent < K > ,
1007
1014
{
0 commit comments