@@ -150,7 +150,7 @@ pub use fx::FxHashBuilder as DefaultHashBuilder;
150150/// }
151151///
152152/// impl Viking {
153- /// /// Create a new Viking.
153+ /// /// Creates a new Viking.
154154/// fn new(name: &str, country: &str) -> Viking {
155155/// Viking { name: name.to_string(), country: country.to_string() }
156156/// }
@@ -186,12 +186,12 @@ pub use fx::FxHashBuilder as DefaultHashBuilder;
186186
187187#[ derive( Clone ) ]
188188pub struct HashMap < K , V , S = DefaultHashBuilder > {
189- hash_builder : S ,
189+ pub ( crate ) hash_builder : S ,
190190 pub ( crate ) table : RawTable < ( K , V ) > ,
191191}
192192
193193#[ inline]
194- fn make_hash < K : Hash + ?Sized > ( hash_builder : & impl BuildHasher , val : & K ) -> u64 {
194+ pub ( crate ) fn make_hash < K : Hash + ?Sized > ( hash_builder : & impl BuildHasher , val : & K ) -> u64 {
195195 let mut state = hash_builder. build_hasher ( ) ;
196196 val. hash ( & mut state) ;
197197 state. finish ( )
@@ -232,8 +232,6 @@ impl<K, V> HashMap<K, V, DefaultHashBuilder> {
232232}
233233
234234impl < K , V , S > HashMap < K , V , S >
235- where
236- S : BuildHasher ,
237235{
238236 /// Creates an empty `HashMap` which will use the given hash builder to hash
239237 /// keys.
@@ -486,7 +484,7 @@ where
486484 self . table . len ( )
487485 }
488486
489- /// Returns true if the map contains no elements.
487+ /// Returns ` true` if the map contains no elements.
490488 ///
491489 /// # Examples
492490 ///
@@ -757,7 +755,7 @@ where
757755 } )
758756 }
759757
760- /// Returns true if the map contains a value for the specified key.
758+ /// Returns ` true` if the map contains a value for the specified key.
761759 ///
762760 /// The key may be any borrowed form of the map's key type, but
763761 /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
@@ -1220,7 +1218,7 @@ impl<'a, K, V: Debug> fmt::Debug for Values<'a, K, V> {
12201218/// [`drain`]: struct.HashMap.html#method.drain
12211219/// [`HashMap`]: struct.HashMap.html
12221220pub struct Drain < ' a , K : ' a , V : ' a > {
1223- pub ( super ) inner : RawDrain < ' a , ( K , V ) > ,
1221+ inner : RawDrain < ' a , ( K , V ) > ,
12241222}
12251223
12261224impl < ' a , K , V > Drain < ' a , K , V > {
@@ -1300,9 +1298,8 @@ pub struct RawEntryBuilder<'a, K: 'a, V: 'a, S: 'a> {
13001298impl < ' a , K , V , S > RawEntryBuilderMut < ' a , K , V , S >
13011299where
13021300 S : BuildHasher ,
1303- K : Eq + Hash ,
13041301{
1305- /// Create a `RawEntryMut` from the given key.
1302+ /// Creates a `RawEntryMut` from the given key.
13061303 #[ inline]
13071304 #[ allow( clippy:: wrong_self_convention) ]
13081305 pub fn from_key < Q : ?Sized > ( self , k : & Q ) -> RawEntryMut < ' a , K , V , S >
@@ -1315,7 +1312,7 @@ where
13151312 self . from_key_hashed_nocheck ( hasher. finish ( ) , k)
13161313 }
13171314
1318- /// Create a `RawEntryMut` from the given key and its hash.
1315+ /// Creates a `RawEntryMut` from the given key and its hash.
13191316 #[ inline]
13201317 #[ allow( clippy:: wrong_self_convention) ]
13211318 pub fn from_key_hashed_nocheck < Q : ?Sized > ( self , hash : u64 , k : & Q ) -> RawEntryMut < ' a , K , V , S >
@@ -1331,7 +1328,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S>
13311328where
13321329 S : BuildHasher ,
13331330{
1334- /// Create a `RawEntryMut` from the given hash.
1331+ /// Creates a `RawEntryMut` from the given hash.
13351332 #[ inline]
13361333 #[ allow( clippy:: wrong_self_convention) ]
13371334 pub fn from_hash < F > ( self , hash : u64 , is_match : F ) -> RawEntryMut < ' a , K , V , S >
@@ -1706,7 +1703,7 @@ pub enum Entry<'a, K: 'a, V: 'a, S: 'a> {
17061703 Vacant ( VacantEntry < ' a , K , V , S > ) ,
17071704}
17081705
1709- impl < ' a , K : ' a + Debug + Eq + Hash , V : ' a + Debug , S : ' a > Debug for Entry < ' a , K , V , S > {
1706+ impl < ' a , K : ' a + Debug , V : ' a + Debug , S : ' a > Debug for Entry < ' a , K , V , S > {
17101707 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
17111708 match * self {
17121709 Entry :: Vacant ( ref v) => f. debug_tuple ( "Entry" ) . field ( v) . finish ( ) ,
@@ -1759,17 +1756,13 @@ pub struct VacantEntry<'a, K: 'a, V: 'a, S: 'a> {
17591756 table : & ' a mut HashMap < K , V , S > ,
17601757}
17611758
1762- impl < ' a , K : ' a + Debug + Eq + Hash , V : ' a , S > Debug for VacantEntry < ' a , K , V , S > {
1759+ impl < ' a , K : ' a + Debug , V : ' a , S > Debug for VacantEntry < ' a , K , V , S > {
17631760 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
17641761 f. debug_tuple ( "VacantEntry" ) . field ( self . key ( ) ) . finish ( )
17651762 }
17661763}
17671764
1768- impl < ' a , K , V , S > IntoIterator for & ' a HashMap < K , V , S >
1769- where
1770- K : Eq + Hash ,
1771- S : BuildHasher ,
1772- {
1765+ impl < ' a , K , V , S > IntoIterator for & ' a HashMap < K , V , S > {
17731766 type Item = ( & ' a K , & ' a V ) ;
17741767 type IntoIter = Iter < ' a , K , V > ;
17751768
@@ -1779,11 +1772,7 @@ where
17791772 }
17801773}
17811774
1782- impl < ' a , K , V , S > IntoIterator for & ' a mut HashMap < K , V , S >
1783- where
1784- K : Eq + Hash ,
1785- S : BuildHasher ,
1786- {
1775+ impl < ' a , K , V , S > IntoIterator for & ' a mut HashMap < K , V , S > {
17871776 type Item = ( & ' a K , & ' a mut V ) ;
17881777 type IntoIter = IterMut < ' a , K , V > ;
17891778
@@ -1793,11 +1782,7 @@ where
17931782 }
17941783}
17951784
1796- impl < K , V , S > IntoIterator for HashMap < K , V , S >
1797- where
1798- K : Eq + Hash ,
1799- S : BuildHasher ,
1800- {
1785+ impl < K , V , S > IntoIterator for HashMap < K , V , S > {
18011786 type Item = ( K , V ) ;
18021787 type IntoIter = IntoIter < K , V > ;
18031788
0 commit comments