@@ -218,7 +218,7 @@ pub(crate) fn make_hasher<K: Hash, V>(
218
218
/// Ensures that a single closure type across uses of this which, in turn prevents multiple
219
219
/// instances of any functions like RawTable::reserve from being generated
220
220
#[ cfg_attr( feature = "inline-more" , inline) ]
221
- fn equivalent < Q , K , V > ( k : & Q ) -> impl Fn ( & ( K , V ) ) -> bool + ' _
221
+ fn equivalent_key < Q , K , V > ( k : & Q ) -> impl Fn ( & ( K , V ) ) -> bool + ' _
222
222
where
223
223
K : Borrow < Q > ,
224
224
Q : ?Sized + Eq ,
@@ -229,7 +229,7 @@ where
229
229
/// Ensures that a single closure type across uses of this which, in turn prevents multiple
230
230
/// instances of any functions like RawTable::reserve from being generated
231
231
#[ cfg_attr( feature = "inline-more" , inline) ]
232
- fn equivalent_single < Q , K > ( k : & Q ) -> impl Fn ( & K ) -> bool + ' _
232
+ fn equivalent < Q , K > ( k : & Q ) -> impl Fn ( & K ) -> bool + ' _
233
233
where
234
234
K : Borrow < Q > ,
235
235
Q : ?Sized + Eq ,
@@ -792,7 +792,7 @@ where
792
792
#[ cfg_attr( feature = "inline-more" , inline) ]
793
793
pub fn entry ( & mut self , key : K ) -> Entry < ' _ , K , V , S > {
794
794
let hash = make_hash ( & self . hash_builder , & key) ;
795
- if let Some ( elem) = self . table . find ( hash, equivalent ( & key) ) {
795
+ if let Some ( elem) = self . table . find ( hash, equivalent_key ( & key) ) {
796
796
Entry :: Occupied ( OccupiedEntry {
797
797
hash,
798
798
key : Some ( key) ,
@@ -879,7 +879,7 @@ where
879
879
Q : Hash + Eq ,
880
880
{
881
881
let hash = make_hash ( & self . hash_builder , k) ;
882
- self . table . get ( hash, equivalent ( k) )
882
+ self . table . get ( hash, equivalent_key ( k) )
883
883
}
884
884
885
885
/// Returns the key-value pair corresponding to the supplied key, with a mutable reference to value.
@@ -987,7 +987,7 @@ where
987
987
Q : Hash + Eq ,
988
988
{
989
989
let hash = make_hash ( & self . hash_builder , k) ;
990
- self . table . get_mut ( hash, equivalent ( k) )
990
+ self . table . get_mut ( hash, equivalent_key ( k) )
991
991
}
992
992
993
993
/// Inserts a key-value pair into the map.
@@ -1018,7 +1018,7 @@ where
1018
1018
#[ cfg_attr( feature = "inline-more" , inline) ]
1019
1019
pub fn insert ( & mut self , k : K , v : V ) -> Option < V > {
1020
1020
let hash = make_hash ( & self . hash_builder , & k) ;
1021
- if let Some ( ( _, item) ) = self . table . get_mut ( hash, equivalent ( & k) ) {
1021
+ if let Some ( ( _, item) ) = self . table . get_mut ( hash, equivalent_key ( & k) ) {
1022
1022
Some ( mem:: replace ( item, v) )
1023
1023
} else {
1024
1024
self . table
@@ -1087,7 +1087,7 @@ where
1087
1087
Q : Hash + Eq ,
1088
1088
{
1089
1089
let hash = make_hash ( & self . hash_builder , & k) ;
1090
- self . table . remove_entry ( hash, equivalent ( k) )
1090
+ self . table . remove_entry ( hash, equivalent_key ( k) )
1091
1091
}
1092
1092
}
1093
1093
@@ -1554,7 +1554,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> {
1554
1554
K : Borrow < Q > ,
1555
1555
Q : Eq ,
1556
1556
{
1557
- self . from_hash ( hash, equivalent_single ( k) )
1557
+ self . from_hash ( hash, equivalent ( k) )
1558
1558
}
1559
1559
}
1560
1560
@@ -1611,7 +1611,7 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S> {
1611
1611
K : Borrow < Q > ,
1612
1612
Q : Eq ,
1613
1613
{
1614
- self . from_hash ( hash, equivalent_single ( k) )
1614
+ self . from_hash ( hash, equivalent ( k) )
1615
1615
}
1616
1616
1617
1617
#[ cfg_attr( feature = "inline-more" , inline) ]
@@ -2001,17 +2001,18 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
2001
2001
K : Hash ,
2002
2002
S : BuildHasher ,
2003
2003
{
2004
- let hash_builder = self . hash_builder ;
2005
- let mut hasher = hash_builder. build_hasher ( ) ;
2004
+ let mut hasher = self . hash_builder . build_hasher ( ) ;
2006
2005
key. hash ( & mut hasher) ;
2007
2006
2008
- let elem = self
2009
- . table
2010
- . insert ( hasher. finish ( ) , ( key, value) , make_hasher ( hash_builder) ) ;
2007
+ let elem = self . table . insert (
2008
+ hasher. finish ( ) ,
2009
+ ( key, value) ,
2010
+ make_hasher ( self . hash_builder ) ,
2011
+ ) ;
2011
2012
RawOccupiedEntryMut {
2012
2013
elem,
2013
2014
table : self . table ,
2014
- hash_builder,
2015
+ hash_builder : self . hash_builder ,
2015
2016
}
2016
2017
}
2017
2018
}
0 commit comments