Clean up 'HashMap' and 'HashSet' docs;

This commit is contained in:
Gabriel Bjørnager Jensen 2025-02-07 13:40:04 +01:00
parent 550e035a59
commit 450b864d69
2 changed files with 8 additions and 8 deletions

View File

@ -282,7 +282,7 @@ impl<K, V, S> HashMap<K, V, S> {
/// manually using this function can expose a DoS attack vector.
///
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
/// the HashMap to be useful, see its documentation for details.
/// the `HashMap` to be useful, see its documentation for details.
///
/// # Examples
///
@ -314,7 +314,7 @@ impl<K, V, S> HashMap<K, V, S> {
/// manually using this function can expose a DoS attack vector.
///
/// The `hasher` passed should implement the [`BuildHasher`] trait for
/// the HashMap to be useful, see its documentation for details.
/// the `HashMap` to be useful, see its documentation for details.
///
/// # Examples
///
@ -1283,7 +1283,7 @@ impl<K, V, S> HashMap<K, V, S>
where
S: BuildHasher,
{
/// Creates a raw entry builder for the HashMap.
/// Creates a raw entry builder for the `HashMap`.
///
/// Raw entries provide the lowest level of control for searching and
/// manipulating a map. They must be manually initialized with a hash and
@ -1298,13 +1298,13 @@ where
/// * Using custom comparison logic without newtype wrappers
///
/// Because raw entries provide much more low-level control, it's much easier
/// to put the HashMap into an inconsistent state which, while memory-safe,
/// to put the `HashMap` into an inconsistent state which, while memory-safe,
/// will cause the map to produce seemingly random results. Higher-level and
/// more foolproof APIs like `entry` should be preferred when possible.
///
/// In particular, the hash used to initialize the raw entry must still be
/// consistent with the hash of the key that is ultimately stored in the entry.
/// This is because implementations of HashMap may need to recompute hashes
/// This is because implementations of `HashMap` may need to recompute hashes
/// when resizing, at which point only the keys are available.
///
/// Raw entries give mutable access to the keys. This must not be used
@ -1320,7 +1320,7 @@ where
RawEntryBuilderMut { map: self }
}
/// Creates a raw immutable entry builder for the HashMap.
/// Creates a raw immutable entry builder for the `HashMap`.
///
/// Raw entries provide the lowest level of control for searching and
/// manipulating a map. They must be manually initialized with a hash and

View File

@ -374,7 +374,7 @@ impl<T, S> HashSet<T, S> {
/// manually using this function can expose a DoS attack vector.
///
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
/// the HashMap to be useful, see its documentation for details.
/// the `HashSet` to be useful, see its documentation for details.
///
/// # Examples
///
@ -406,7 +406,7 @@ impl<T, S> HashSet<T, S> {
/// manually using this function can expose a DoS attack vector.
///
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
/// the HashMap to be useful, see its documentation for details.
/// the `HashSet` to be useful, see its documentation for details.
///
/// # Examples
///