pub trait InsertImmutable { fn insert(&self, item: Item) -> bool; } mod trait_impls { use std::{cell::RefCell, hash::Hash}; use dashmap::DashSet; use git_hashtable::HashSet; use super::InsertImmutable; impl InsertImmutable for DashSet { fn insert(&self, item: T) -> bool { self.insert(item) } } impl InsertImmutable for RefCell> { fn insert(&self, item: T) -> bool { self.borrow_mut().insert(item) } } }