Just like inserting, the retrieval process has the same steps. Whether the get() function to return a value or the remove() function, both go through the same steps: hash, match a bucket, do a linear search, and lastly, match with the expected return type. The get() function can utilize Rust's powerful iterators by using find to match the predicate within a bucket's vector and, since an Option<Item> is returned, its map function to extract the value instead of returning the entire pair:
pub fn get(&self, key: &K) -> Option<V> {
let h = (self.hash_fn)(key);
let idx = h & (self.store.len() - 1);
self.store[idx]
.iter()
.find(|e| e.0 == *key)
.map(|e| e.1.clone())
}
pub fn remove(&mut self, key: K) -> Option<V> {
let h = (self.hash_fn)(&key);
let idx = h & (self.store.len() - 1);
match self.store[idx].iter().position(|e| e.0 == key) {
Some(pos) => {
self...