mirror of https://github.com/xacrimon/dashmap
fmt
This commit is contained in:
parent
3b418466ed
commit
6616a8d28c
|
@ -100,7 +100,10 @@ impl<'a, K: Eq + Hash, V, S: BuildHasher> Entry<'a, K, V, S> {
|
|||
/// consider [`insert`] as it doesn't need to clone the key.
|
||||
///
|
||||
/// [`insert`]: Entry::insert
|
||||
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, S> where K: Clone {
|
||||
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, S>
|
||||
where
|
||||
K: Clone,
|
||||
{
|
||||
match self {
|
||||
Entry::Occupied(mut entry) => {
|
||||
entry.insert(value);
|
||||
|
@ -145,7 +148,10 @@ impl<'a, K: Eq + Hash, V, S: BuildHasher> VacantEntry<'a, K, V, S> {
|
|||
}
|
||||
|
||||
/// Sets the value of the entry with the VacantEntry’s key, and returns an OccupiedEntry.
|
||||
pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, S> where K: Clone {
|
||||
pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, S>
|
||||
where
|
||||
K: Clone,
|
||||
{
|
||||
unsafe {
|
||||
self.shard.insert(self.key.clone(), SharedValue::new(value));
|
||||
|
||||
|
@ -230,8 +236,6 @@ impl<'a, K: Eq + Hash, V, S: BuildHasher> OccupiedEntry<'a, K, V, S> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::DashMap;
|
||||
|
|
Loading…
Reference in New Issue