@@ -235,9 +235,8 @@ const DISPLACEMENT_THRESHOLD: usize = 128;
235
235
/// attacks such as HashDoS.
236
236
///
237
237
/// The hashing algorithm can be replaced on a per-`HashMap` basis using the
238
- /// [`HashMap::default`], [`HashMap::with_hasher`], and
239
- /// [`HashMap::with_capacity_and_hasher`] methods. Many alternative algorithms
240
- /// are available on crates.io, such as the [`fnv`] crate.
238
+ /// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. Many
239
+ /// alternative algorithms are available on crates.io, such as the [`fnv`] crate.
241
240
///
242
241
/// It is required that the keys implement the [`Eq`] and [`Hash`] traits, although
243
242
/// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`.
@@ -339,9 +338,9 @@ const DISPLACEMENT_THRESHOLD: usize = 128;
339
338
/// [`PartialEq`]: ../../std/cmp/trait.PartialEq.html
340
339
/// [`RefCell`]: ../../std/cell/struct.RefCell.html
341
340
/// [`Cell`]: ../../std/cell/struct.Cell.html
342
- /// [`HashMap:: default`]: #method.default
343
- /// [`HashMap:: with_hasher`]: #method.with_hasher
344
- /// [`HashMap:: with_capacity_and_hasher`]: #method.with_capacity_and_hasher
341
+ /// [`default`]: #method.default
342
+ /// [`with_hasher`]: #method.with_hasher
343
+ /// [`with_capacity_and_hasher`]: #method.with_capacity_and_hasher
345
344
/// [`fnv`]: https://crates.io/crates/fnv
346
345
///
347
346
/// ```
@@ -373,7 +372,7 @@ const DISPLACEMENT_THRESHOLD: usize = 128;
373
372
/// }
374
373
/// ```
375
374
///
376
- /// A HashMap with fixed list of elements can be initialized from an array:
375
+ /// A ` HashMap` with fixed list of elements can be initialized from an array:
377
376
///
378
377
/// ```
379
378
/// use std::collections::HashMap;
@@ -654,12 +653,13 @@ impl<K, V, S> HashMap<K, V, S>
654
653
}
655
654
}
656
655
657
- /// Creates an empty `HashMap` with the specified capacity, using `hasher `
656
+ /// Creates an empty `HashMap` with the specified capacity, using `hash_builder `
658
657
/// to hash the keys.
659
658
///
660
659
/// The hash map will be able to hold at least `capacity` elements without
661
660
/// reallocating. If `capacity` is 0, the hash map will not allocate.
662
- /// Warning: `hasher` is normally randomly generated, and
661
+ ///
662
+ /// Warning: `hash_builder` is normally randomly generated, and
663
663
/// is designed to allow HashMaps to be resistant to attacks that
664
664
/// cause many collisions and very poor performance. Setting it
665
665
/// manually using this function can expose a DoS attack vector.
@@ -686,7 +686,9 @@ impl<K, V, S> HashMap<K, V, S>
686
686
}
687
687
}
688
688
689
- /// Returns a reference to the map's hasher.
689
+ /// Returns a reference to the map's [`BuildHasher`].
690
+ ///
691
+ /// [`BuildHasher`]: ../../std/hash/trait.BuildHasher.html
690
692
#[ stable( feature = "hashmap_public_hasher" , since = "1.9.0" ) ]
691
693
pub fn hasher ( & self ) -> & S {
692
694
& self . hash_builder
@@ -849,7 +851,7 @@ impl<K, V, S> HashMap<K, V, S>
849
851
}
850
852
851
853
/// An iterator visiting all keys in arbitrary order.
852
- /// Iterator element type is `&'a K`.
854
+ /// The iterator element type is `&'a K`.
853
855
///
854
856
/// # Examples
855
857
///
@@ -871,7 +873,7 @@ impl<K, V, S> HashMap<K, V, S>
871
873
}
872
874
873
875
/// An iterator visiting all values in arbitrary order.
874
- /// Iterator element type is `&'a V`.
876
+ /// The iterator element type is `&'a V`.
875
877
///
876
878
/// # Examples
877
879
///
@@ -893,7 +895,7 @@ impl<K, V, S> HashMap<K, V, S>
893
895
}
894
896
895
897
/// An iterator visiting all values mutably in arbitrary order.
896
- /// Iterator element type is `&'a mut V`.
898
+ /// The iterator element type is `&'a mut V`.
897
899
///
898
900
/// # Examples
899
901
///
@@ -920,7 +922,7 @@ impl<K, V, S> HashMap<K, V, S>
920
922
}
921
923
922
924
/// An iterator visiting all key-value pairs in arbitrary order.
923
- /// Iterator element type is `(&'a K, &'a V)`.
925
+ /// The iterator element type is `(&'a K, &'a V)`.
924
926
///
925
927
/// # Examples
926
928
///
@@ -943,7 +945,7 @@ impl<K, V, S> HashMap<K, V, S>
943
945
944
946
/// An iterator visiting all key-value pairs in arbitrary order,
945
947
/// with mutable references to the values.
946
- /// Iterator element type is `(&'a K, &'a mut V)`.
948
+ /// The iterator element type is `(&'a K, &'a mut V)`.
947
949
///
948
950
/// # Examples
949
951
///
@@ -2408,10 +2410,9 @@ impl DefaultHasher {
2408
2410
2409
2411
#[ stable( feature = "hashmap_default_hasher" , since = "1.13.0" ) ]
2410
2412
impl Default for DefaultHasher {
2411
- /// Creates a new `DefaultHasher` using [`DefaultHasher::new`]. See
2412
- /// [`DefaultHasher::new`] documentation for more information.
2413
+ /// Creates a new `DefaultHasher` using [`new`]. See its documentation for more.
2413
2414
///
2414
- /// [`DefaultHasher:: new`]: #method.new
2415
+ /// [`new`]: #method.new
2415
2416
fn default ( ) -> DefaultHasher {
2416
2417
DefaultHasher :: new ( )
2417
2418
}
0 commit comments