style: cleanup insert_only_chashmap.rs (#63)

This commit is contained in:
Mingwei Samuel 2024-02-24 00:27:29 -08:00
parent 092ea34358
commit 4faa8e83e4

View file

@ -1,4 +1,3 @@
// use std::borrow::Borrow;
use std::collections::HashMap;
use std::hash::Hash;
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]
pub fn get_or_insert_with<F: FnOnce() -> V>(&self, key: K, default: F) -> Arc<V> {
Arc::clone(