fn par_retain<K, V, F: Fn(&K, &V) -> bool>(map: &DashMap<K, V>, retain_fn: F)
where
    K: Eq + Hash + Send + Sync,
    V: Send + Sync,
    F: Send + Sync,
{
    map.shards()
        .iter()
        .par_bridge()
        .for_each(|s| s.write().retain(|k, v| retain_fn(k, v.get())));
}
// Helper function! Lives here because it has nowhere else to go ;-;
Helper function. Lives here because it has nowhere else to go ;-.
Helper function . Lives here because it has nowhere else to go ; - .
fn par_retain<K, V, F: Fn(&K, &V) -> bool>(map: &DashMap<K, V>, retain_fn: F)
where
    K: Eq + Hash + Send + Sync,
    V: Send + Sync,
    F: Send + Sync,
{
    map.shards()
        .iter()
        .par_bridge()
        .for_each(|s| s.write().retain(|k, v| retain_fn(k, v.get())));
}
fn par_retain < K , V , F : Fn ( & K , & V ) -> bool > ( map : & DashMap < K , V > , retain_fn : F ) where K : Eq + Hash + Send + Sync , V : Send + Sync , F : Send + Sync , { map . shards ( ) . iter ( ) . par_bridge ( ) . for_each ( | s | s . write ( ) . retain ( | k , v | retain_fn ( k , v . get ( ) ) ) ) ; }
Helper function!
Helper function!
map
&DashMap<K, V>
retain_fn
F
map
&DashMap<K, V>
retain_fn
F