@@ -251,6 +251,9 @@ impl<K, V, S> HashMap<K, V, S> {
251
251
/// cause many collisions and very poor performance. Setting it
252
252
/// manually using this function can expose a DoS attack vector.
253
253
///
254
+ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for
255
+ /// the HashMap to be useful, see its documentation for details.
256
+ ///
254
257
/// # Examples
255
258
///
256
259
/// ```
@@ -261,6 +264,8 @@ impl<K, V, S> HashMap<K, V, S> {
261
264
/// let mut map = HashMap::with_hasher(s);
262
265
/// map.insert(1, 2);
263
266
/// ```
267
+ ///
268
+ /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
264
269
#[ inline]
265
270
#[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
266
271
pub fn with_hasher ( hash_builder : S ) -> HashMap < K , V , S > {
@@ -278,6 +283,9 @@ impl<K, V, S> HashMap<K, V, S> {
278
283
/// cause many collisions and very poor performance. Setting it
279
284
/// manually using this function can expose a DoS attack vector.
280
285
///
286
+ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for
287
+ /// the HashMap to be useful, see its documentation for details.
288
+ ///
281
289
/// # Examples
282
290
///
283
291
/// ```
@@ -288,6 +296,8 @@ impl<K, V, S> HashMap<K, V, S> {
288
296
/// let mut map = HashMap::with_capacity_and_hasher(10, s);
289
297
/// map.insert(1, 2);
290
298
/// ```
299
+ ///
300
+ /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
291
301
#[ inline]
292
302
#[ stable( feature = "hashmap_build_hasher" , since = "1.7.0" ) ]
293
303
pub fn with_capacity_and_hasher ( capacity : usize , hash_builder : S ) -> HashMap < K , V , S > {
0 commit comments