style: cleanup `insert_only_chashmap.rs` (#63)

pull/64/head
Mingwei Samuel 2024-02-24 00:27:29 -08:00
parent 092ea34358
commit 4faa8e83e4
1 changed files with 0 additions and 10 deletions

View File

@ -1,4 +1,3 @@
// use std::borrow::Borrow;
use std::collections::HashMap; use std::collections::HashMap;
use std::hash::Hash; use std::hash::Hash;
use std::sync::Arc; use std::sync::Arc;
@ -17,15 +16,6 @@ impl<K: Hash + Eq, V> InsertOnlyCHashMap<K, V> {
} }
} }
// #[inline]
// pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<Arc<V>>
// where
// K: Borrow<Q>,
// Q: Hash + Eq,
// {
// self.base.lock().get(key).map(|v| Arc::clone(v))
// }
#[inline] #[inline]
pub fn get_or_insert_with<F: FnOnce() -> V>(&self, key: K, default: F) -> Arc<V> { pub fn get_or_insert_with<F: FnOnce() -> V>(&self, key: K, default: F) -> Arc<V> {
Arc::clone( Arc::clone(