This commit is contained in:
Joel 2023-01-20 08:08:52 +01:00 committed by GitHub
parent 8a0149d31b
commit 7f9522c528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -331,7 +331,7 @@ impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> DashMap<K, V, S> {
/// use dashmap::SharedValue; /// use dashmap::SharedValue;
/// ///
/// let mut map = DashMap::<i32, &'static str>::new(); /// let mut map = DashMap::<i32, &'static str>::new();
/// let shard_ind = map.determine_map(&42); /// let shard_ind = map.determine_map(&42);
/// map.shards_mut()[shard_ind].get_mut().insert(42, SharedValue::new("forty two")); /// map.shards_mut()[shard_ind].get_mut().insert(42, SharedValue::new("forty two"));
/// assert_eq!(*map.get(&42).unwrap(), "forty two"); /// assert_eq!(*map.get(&42).unwrap(), "forty two");
/// ``` /// ```
@ -341,9 +341,9 @@ impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> DashMap<K, V, S> {
/// Consumes this `DashMap` and returns the inner shards. /// Consumes this `DashMap` and returns the inner shards.
/// You should probably not use this unless you know what you are doing. /// You should probably not use this unless you know what you are doing.
/// ///
/// Requires the `raw-api` feature to be enabled. /// Requires the `raw-api` feature to be enabled.
/// ///
/// See [`DashMap::shards()`] and [`DashMap::shards_mut()`] for more information. /// See [`DashMap::shards()`] and [`DashMap::shards_mut()`] for more information.
pub fn into_shards(self) -> Box<[RwLock<HashMap<K, V, S>>]> { pub fn into_shards(self) -> Box<[RwLock<HashMap<K, V, S>>]> {
self.shards self.shards