@@ -106,7 +106,6 @@ impl Map<String, Value> {
106106 /// The key may be any borrowed form of the map's key type, but the ordering
107107 /// on the borrowed form *must* match the ordering on the key type.
108108 #[ inline]
109- #[ cfg( any( feature = "preserve_order" , not( no_btreemap_get_key_value) ) ) ]
110109 pub fn get_key_value < Q > ( & self , key : & Q ) -> Option < ( & String , & Value ) >
111110 where
112111 String : Borrow < Q > ,
@@ -153,44 +152,7 @@ impl Map<String, Value> {
153152 String : Borrow < Q > ,
154153 Q : ?Sized + Ord + Eq + Hash ,
155154 {
156- #[ cfg( any( feature = "preserve_order" , not( no_btreemap_remove_entry) ) ) ]
157- return self . map . remove_entry ( key) ;
158- #[ cfg( all(
159- not( feature = "preserve_order" ) ,
160- no_btreemap_remove_entry,
161- not( no_btreemap_get_key_value) ,
162- ) ) ]
163- {
164- let ( key, _value) = self . map . get_key_value ( key) ?;
165- let key = key. clone ( ) ;
166- let value = self . map . remove :: < String > ( & key) ?;
167- Some ( ( key, value) )
168- }
169- #[ cfg( all(
170- not( feature = "preserve_order" ) ,
171- no_btreemap_remove_entry,
172- no_btreemap_get_key_value,
173- ) ) ]
174- {
175- use core:: ops:: { Bound , RangeBounds } ;
176-
177- struct Key < ' a , Q : ?Sized > ( & ' a Q ) ;
178-
179- impl < ' a , Q : ?Sized > RangeBounds < Q > for Key < ' a , Q > {
180- fn start_bound ( & self ) -> Bound < & Q > {
181- Bound :: Included ( self . 0 )
182- }
183- fn end_bound ( & self ) -> Bound < & Q > {
184- Bound :: Included ( self . 0 )
185- }
186- }
187-
188- let mut range = self . map . range ( Key ( key) ) ;
189- let ( key, _value) = range. next ( ) ?;
190- let key = key. clone ( ) ;
191- let value = self . map . remove :: < String > ( & key) ?;
192- Some ( ( key, value) )
193- }
155+ self . map . remove_entry ( key)
194156 }
195157
196158 /// Moves all elements from other into self, leaving other empty.
@@ -276,7 +238,6 @@ impl Map<String, Value> {
276238 ///
277239 /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)`
278240 /// returns `false`.
279- #[ cfg( not( no_btreemap_retain) ) ]
280241 #[ inline]
281242 pub fn retain < F > ( & mut self , f : F )
282243 where
0 commit comments