@@ -213,7 +213,7 @@ pub(crate) fn make_hasher<K, Q, V, S>(hash_builder: &S) -> impl Fn(&(Q, V)) -> u
213
213
where
214
214
K : Borrow < Q > ,
215
215
Q : Hash ,
216
- S : BuildHasher
216
+ S : BuildHasher ,
217
217
{
218
218
move |val| make_hash :: < K , Q , S > ( hash_builder, & val. 0 )
219
219
}
@@ -242,10 +242,10 @@ where
242
242
243
243
#[ cfg_attr( feature = "inline-more" , inline) ]
244
244
pub ( crate ) fn make_hash < K , Q , S > ( hash_builder : & S , val : & Q ) -> u64
245
- where
246
- K : Borrow < Q > ,
247
- Q : Hash + ?Sized ,
248
- S : BuildHasher
245
+ where
246
+ K : Borrow < Q > ,
247
+ Q : Hash + ?Sized ,
248
+ S : BuildHasher ,
249
249
{
250
250
#[ cfg( feature = "ahash" ) ]
251
251
{
@@ -265,24 +265,24 @@ pub(crate) fn make_hash<K, Q, S>(hash_builder: &S, val: &Q) -> u64
265
265
266
266
#[ cfg_attr( feature = "inline-more" , inline) ]
267
267
pub ( crate ) fn make_insert_hash < K , S > ( hash_builder : & S , val : & K ) -> u64
268
- where
269
- K : Hash ,
270
- S : BuildHasher
268
+ where
269
+ K : Hash ,
270
+ S : BuildHasher ,
271
271
{
272
272
#[ cfg( feature = "ahash" ) ]
273
- {
274
- //This enables specialization to improve performance on primitive types
275
- use ahash:: CallHasher ;
276
- let state = hash_builder. build_hasher ( ) ;
277
- K :: get_hash ( val, state)
278
- }
273
+ {
274
+ //This enables specialization to improve performance on primitive types
275
+ use ahash:: CallHasher ;
276
+ let state = hash_builder. build_hasher ( ) ;
277
+ K :: get_hash ( val, state)
278
+ }
279
279
#[ cfg( not( feature = "ahash" ) ) ]
280
- {
281
- use core:: hash:: Hasher ;
282
- let mut state = hash_builder. build_hasher ( ) ;
283
- val. hash ( & mut state) ;
284
- state. finish ( )
285
- }
280
+ {
281
+ use core:: hash:: Hasher ;
282
+ let mut state = hash_builder. build_hasher ( ) ;
283
+ val. hash ( & mut state) ;
284
+ state. finish ( )
285
+ }
286
286
}
287
287
288
288
#[ cfg( feature = "ahash" ) ]
@@ -860,7 +860,8 @@ where
860
860
/// ```
861
861
#[ cfg_attr( feature = "inline-more" , inline) ]
862
862
pub fn shrink_to_fit ( & mut self ) {
863
- self . table . shrink_to ( 0 , make_hasher :: < K , _ , V , S > ( & self . hash_builder ) ) ;
863
+ self . table
864
+ . shrink_to ( 0 , make_hasher :: < K , _ , V , S > ( & self . hash_builder ) ) ;
864
865
}
865
866
866
867
/// Shrinks the capacity of the map with a lower limit. It will drop
@@ -1269,7 +1270,6 @@ impl<K, V, S, A: AllocRef + Clone> HashMap<K, V, S, A> {
1269
1270
pub fn raw_entry ( & self ) -> RawEntryBuilder < ' _ , K , V , S , A > {
1270
1271
RawEntryBuilder { map : self }
1271
1272
}
1272
-
1273
1273
}
1274
1274
1275
1275
impl < K , V , S , A > PartialEq for HashMap < K , V , S , A >
@@ -2098,9 +2098,11 @@ impl<'a, K, V, S, A: AllocRef + Clone> RawVacantEntryMut<'a, K, V, S, A> {
2098
2098
K : Hash ,
2099
2099
S : BuildHasher ,
2100
2100
{
2101
- let & mut ( ref mut k, ref mut v) =
2102
- self . table
2103
- . insert_entry ( hash, ( key, value) , make_hasher :: < K , _ , V , S > ( self . hash_builder ) ) ;
2101
+ let & mut ( ref mut k, ref mut v) = self . table . insert_entry (
2102
+ hash,
2103
+ ( key, value) ,
2104
+ make_hasher :: < K , _ , V , S > ( self . hash_builder ) ,
2105
+ ) ;
2104
2106
( k, v)
2105
2107
}
2106
2108
@@ -2129,9 +2131,11 @@ impl<'a, K, V, S, A: AllocRef + Clone> RawVacantEntryMut<'a, K, V, S, A> {
2129
2131
S : BuildHasher ,
2130
2132
{
2131
2133
let hash = make_insert_hash :: < K , S > ( self . hash_builder , & key) ;
2132
- let elem = self
2133
- . table
2134
- . insert ( hash, ( key, value) , make_hasher :: < K , _ , V , S > ( self . hash_builder ) ) ;
2134
+ let elem = self . table . insert (
2135
+ hash,
2136
+ ( key, value) ,
2137
+ make_hasher :: < K , _ , V , S > ( self . hash_builder ) ,
2138
+ ) ;
2135
2139
RawOccupiedEntryMut {
2136
2140
elem,
2137
2141
table : self . table ,
0 commit comments