1
Fork 0

Rollup merge of #136686 - bjoernager:master, r=jhpratt

Clean up `HashMap` and `HashSet` docs.

This commit makes some small, pedantic changes to the docs for `HashMap` and `HashSet`, which fixes that:

* "HashMap" is not always formatted as code (as in `HashMap`), and that
* `HashSet` sometimes references `HashMap` instead of itself.
This commit is contained in:
Jubilee 2025-02-08 20:41:20 -08:00 committed by GitHub
commit e7ad8cec96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
///