33//! unless you have need to name one of the iterator types.
44
55use std:: collections:: HashMap ;
6- use std:: hash:: { BuildHasher , Hash } ;
76use std:: marker:: PhantomData ;
87
98use crate :: iter:: plumbing:: * ;
@@ -13,27 +12,27 @@ use crate::vec;
1312
1413/// Parallel iterator over a hash map
1514#[ derive( Debug ) ] // std doesn't Clone
16- pub struct IntoIter < K : Hash + Eq + Send , V : Send > {
15+ pub struct IntoIter < K , V > {
1716 inner : vec:: IntoIter < ( K , V ) > ,
1817}
1918
2019into_par_vec ! {
2120 HashMap <K , V , S > => IntoIter <K , V >,
22- impl <K : Hash + Eq + Send , V : Send , S : BuildHasher >
21+ impl <K : Send , V : Send , S >
2322}
2423
2524delegate_iterator ! {
2625 IntoIter <K , V > => ( K , V ) ,
27- impl <K : Hash + Eq + Send , V : Send >
26+ impl <K : Send , V : Send >
2827}
2928
3029/// Parallel iterator over an immutable reference to a hash map
3130#[ derive( Debug ) ]
32- pub struct Iter < ' a , K : Hash + Eq + Sync , V : Sync > {
31+ pub struct Iter < ' a , K , V > {
3332 inner : vec:: IntoIter < ( & ' a K , & ' a V ) > ,
3433}
3534
36- impl < ' a , K : Hash + Eq + Sync , V : Sync > Clone for Iter < ' a , K , V > {
35+ impl < K , V > Clone for Iter < ' _ , K , V > {
3736 fn clone ( & self ) -> Self {
3837 Iter {
3938 inner : self . inner . clone ( ) ,
@@ -43,41 +42,39 @@ impl<'a, K: Hash + Eq + Sync, V: Sync> Clone for Iter<'a, K, V> {
4342
4443into_par_vec ! {
4544 & ' a HashMap <K , V , S > => Iter <' a, K , V >,
46- impl <' a, K : Hash + Eq + Sync , V : Sync , S : BuildHasher >
45+ impl <' a, K : Sync , V : Sync , S >
4746}
4847
4948delegate_iterator ! {
5049 Iter <' a, K , V > => ( & ' a K , & ' a V ) ,
51- impl <' a, K : Hash + Eq + Sync + ' a , V : Sync + ' a >
50+ impl <' a, K : Sync , V : Sync >
5251}
5352
5453/// Parallel iterator over a mutable reference to a hash map
5554#[ derive( Debug ) ]
56- pub struct IterMut < ' a , K : Hash + Eq + Sync , V : Send > {
55+ pub struct IterMut < ' a , K , V > {
5756 inner : vec:: IntoIter < ( & ' a K , & ' a mut V ) > ,
5857}
5958
6059into_par_vec ! {
6160 & ' a mut HashMap <K , V , S > => IterMut <' a, K , V >,
62- impl <' a, K : Hash + Eq + Sync , V : Send , S : BuildHasher >
61+ impl <' a, K : Sync , V : Send , S >
6362}
6463
6564delegate_iterator ! {
6665 IterMut <' a, K , V > => ( & ' a K , & ' a mut V ) ,
67- impl <' a, K : Hash + Eq + Sync + ' a , V : Send + ' a >
66+ impl <' a, K : Sync , V : Send >
6867}
6968
7069/// Draining parallel iterator that moves out of a hash map,
7170/// but keeps the total capacity.
7271#[ derive( Debug ) ]
73- pub struct Drain < ' a , K : Hash + Eq + Send , V : Send > {
72+ pub struct Drain < ' a , K , V > {
7473 inner : vec:: IntoIter < ( K , V ) > ,
7574 marker : PhantomData < & ' a mut HashMap < K , V > > ,
7675}
7776
78- impl < ' a , K : Hash + Eq + Send , V : Send , S : BuildHasher > ParallelDrainFull
79- for & ' a mut HashMap < K , V , S >
80- {
77+ impl < ' a , K : Send , V : Send , S > ParallelDrainFull for & ' a mut HashMap < K , V , S > {
8178 type Iter = Drain < ' a , K , V > ;
8279 type Item = ( K , V ) ;
8380
@@ -92,5 +89,5 @@ impl<'a, K: Hash + Eq + Send, V: Send, S: BuildHasher> ParallelDrainFull
9289
9390delegate_iterator ! {
9491 Drain <' _, K , V > => ( K , V ) ,
95- impl <K : Hash + Eq + Send , V : Send >
92+ impl <K : Send , V : Send >
9693}
0 commit comments