@@ -958,10 +958,7 @@ where
958
958
}
959
959
}
960
960
961
- impl < K , V , S > HashMap < K , V , S >
962
- where
963
- S : BuildHasher ,
964
- {
961
+ impl < K , V , S > HashMap < K , V , S > {
965
962
/// Creates a raw entry builder for the HashMap.
966
963
///
967
964
/// Raw entries provide the lowest level of control for searching and
@@ -1047,7 +1044,6 @@ impl<K, V, S> Debug for HashMap<K, V, S>
1047
1044
where
1048
1045
K : Debug ,
1049
1046
V : Debug ,
1050
- S : BuildHasher ,
1051
1047
{
1052
1048
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1053
1049
f. debug_map ( ) . entries ( self . iter ( ) ) . finish ( )
@@ -1056,7 +1052,7 @@ where
1056
1052
1057
1053
impl < K , V , S > Default for HashMap < K , V , S >
1058
1054
where
1059
- S : BuildHasher + Default ,
1055
+ S : Default ,
1060
1056
{
1061
1057
/// Creates an empty `HashMap<K, V, S>`, with the `Default` value for the hasher.
1062
1058
#[ cfg_attr( feature = "inline-more" , inline) ]
@@ -1318,15 +1314,13 @@ pub struct RawEntryBuilder<'a, K, V, S> {
1318
1314
map : & ' a HashMap < K , V , S > ,
1319
1315
}
1320
1316
1321
- impl < ' a , K , V , S > RawEntryBuilderMut < ' a , K , V , S >
1322
- where
1323
- S : BuildHasher ,
1324
- {
1317
+ impl < ' a , K , V , S > RawEntryBuilderMut < ' a , K , V , S > {
1325
1318
/// Creates a `RawEntryMut` from the given key.
1326
1319
#[ cfg_attr( feature = "inline-more" , inline) ]
1327
1320
#[ allow( clippy:: wrong_self_convention) ]
1328
1321
pub fn from_key < Q : ?Sized > ( self , k : & Q ) -> RawEntryMut < ' a , K , V , S >
1329
1322
where
1323
+ S : BuildHasher ,
1330
1324
K : Borrow < Q > ,
1331
1325
Q : Hash + Eq ,
1332
1326
{
@@ -1347,10 +1341,7 @@ where
1347
1341
}
1348
1342
}
1349
1343
1350
- impl < ' a , K , V , S > RawEntryBuilderMut < ' a , K , V , S >
1351
- where
1352
- S : BuildHasher ,
1353
- {
1344
+ impl < ' a , K , V , S > RawEntryBuilderMut < ' a , K , V , S > {
1354
1345
/// Creates a `RawEntryMut` from the given hash.
1355
1346
#[ cfg_attr( feature = "inline-more" , inline) ]
1356
1347
#[ allow( clippy:: wrong_self_convention) ]
@@ -1379,15 +1370,13 @@ where
1379
1370
}
1380
1371
}
1381
1372
1382
- impl < ' a , K , V , S > RawEntryBuilder < ' a , K , V , S >
1383
- where
1384
- S : BuildHasher ,
1385
- {
1373
+ impl < ' a , K , V , S > RawEntryBuilder < ' a , K , V , S > {
1386
1374
/// Access an entry by key.
1387
1375
#[ cfg_attr( feature = "inline-more" , inline) ]
1388
1376
#[ allow( clippy:: wrong_self_convention) ]
1389
1377
pub fn from_key < Q : ?Sized > ( self , k : & Q ) -> Option < ( & ' a K , & ' a V ) >
1390
1378
where
1379
+ S : BuildHasher ,
1391
1380
K : Borrow < Q > ,
1392
1381
Q : Hash + Eq ,
1393
1382
{
@@ -1692,7 +1681,6 @@ impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> {
1692
1681
hasher : H ,
1693
1682
) -> ( & ' a mut K , & ' a mut V )
1694
1683
where
1695
- S : BuildHasher ,
1696
1684
H : Fn ( & K ) -> u64 ,
1697
1685
{
1698
1686
unsafe {
@@ -3636,7 +3624,7 @@ mod test_map {
3636
3624
#[ derive( Debug ) ]
3637
3625
struct IntWrapper ( u64 ) ;
3638
3626
3639
- let mut m: HashMap < IntWrapper , ( ) > = HashMap :: new ( ) ;
3627
+ let mut m: HashMap < IntWrapper , ( ) , ( ) > = HashMap :: default ( ) ;
3640
3628
{
3641
3629
assert ! ( m. raw_entry( ) . from_hash( 0 , |k| k. 0 == 0 ) . is_none( ) ) ;
3642
3630
}
0 commit comments