Skip to content

Clean up HashMap and HashSet docs. #136686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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
///
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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
///
Expand Down
Loading