mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Clarify behavior of ShardedHashMap::insert_unique
This commit is contained in:
@@ -185,7 +185,9 @@ pub fn get_or_insert_with(&self, key: K, default: impl FnOnce() -> V) -> V
|
||||
|
||||
/// Insert value into the [`ShardedHashMap`] with unique key.
|
||||
///
|
||||
/// Checks uniqueness if debug_assertions enabled.
|
||||
/// This function panics if debug_assertions are enabled and uniqueness is violated.
|
||||
/// If uniqueness is violated but debug_assertions are disabled then lookups will arbitrarily
|
||||
/// return one of the inserted elements.
|
||||
#[inline]
|
||||
pub fn insert_unique(&self, key: K, value: V) {
|
||||
let hash = make_hash(&key);
|
||||
|
||||
Reference in New Issue
Block a user