Returns the value for `key`, mutably, if any.
(&mut self, key: &K)
| 182 | |
| 183 | /// Returns the value for `key`, mutably, if any. |
| 184 | pub fn get_mut(&mut self, key: &K) -> Option<&mut V> { |
| 185 | match self { |
| 186 | Self::Small(list) => list.iter_mut().find_map(|(k, v)| (k == key).then_some(v)), |
| 187 | Self::Large(map) => map.get_mut(key), |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | impl<K: Eq + Hash, V, const N: usize, const M: usize> Extend<(K, V)> for SmallHashMap<K, V, N, M> { |
no test coverage detected