@@ -5928,8 +5928,7 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator + Clone> EntryRef<'a, 'b, K, Q, V,
5928
5928
#[ cfg_attr( feature = "inline-more" , inline) ]
5929
5929
pub fn and_replace_entry_with < F > ( self , f : F ) -> Self
5930
5930
where
5931
- F : FnOnce ( & Q , V ) -> Option < V > ,
5932
- K : Borrow < Q > ,
5931
+ F : FnOnce ( & K , V ) -> Option < V > ,
5933
5932
{
5934
5933
match self {
5935
5934
EntryRef :: Occupied ( entry) => entry. replace_entry_with ( f) ,
@@ -6294,16 +6293,15 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator + Clone> OccupiedEntryRef<'a, 'b,
6294
6293
#[ cfg_attr( feature = "inline-more" , inline) ]
6295
6294
pub fn replace_entry_with < F > ( self , f : F ) -> EntryRef < ' a , ' b , K , Q , V , S , A >
6296
6295
where
6297
- F : FnOnce ( & Q , V ) -> Option < V > ,
6298
- K : Borrow < Q > ,
6296
+ F : FnOnce ( & K , V ) -> Option < V > ,
6299
6297
{
6300
6298
unsafe {
6301
6299
let mut spare_key = None ;
6302
6300
6303
6301
self . table
6304
6302
. table
6305
6303
. replace_bucket_with ( self . elem . clone ( ) , |( key, value) | {
6306
- if let Some ( new_value) = f ( key. borrow ( ) , value) {
6304
+ if let Some ( new_value) = f ( & key, value) {
6307
6305
Some ( ( key, new_value) )
6308
6306
} else {
6309
6307
spare_key = Some ( KeyOrRef :: Owned ( key) ) ;
0 commit comments