Remove `key` from the map and return the removed value for `key`, if any.
(
&mut self,
key: K,
forest: &mut MapForest<K, V>,
comp: &C,
)
| 153 | |
| 154 | /// Remove `key` from the map and return the removed value for `key`, if any. |
| 155 | pub fn remove<C: Comparator<K>>( |
| 156 | &mut self, |
| 157 | key: K, |
| 158 | forest: &mut MapForest<K, V>, |
| 159 | comp: &C, |
| 160 | ) -> Option<V> { |
| 161 | let mut c = self.cursor_mut(forest, comp); |
| 162 | if c.goto(key).is_some() { |
| 163 | c.remove() |
| 164 | } else { |
| 165 | None |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /// Remove all entries. |
| 170 | pub fn clear(&mut self, forest: &mut MapForest<K, V>) { |
no test coverage detected