Remove `key` from the set and return true. If `key` was not present in the set, return false.
(
&mut self,
key: K,
forest: &mut SetForest<K>,
comp: &C,
)
| 127 | /// |
| 128 | /// If `key` was not present in the set, return false. |
| 129 | pub fn remove<C: Comparator<K>>( |
| 130 | &mut self, |
| 131 | key: K, |
| 132 | forest: &mut SetForest<K>, |
| 133 | comp: &C, |
| 134 | ) -> bool { |
| 135 | let mut c = self.cursor(forest, comp); |
| 136 | if c.goto(key) { |
| 137 | c.remove(); |
| 138 | true |
| 139 | } else { |
| 140 | false |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | /// Remove all entries. |
| 145 | pub fn clear(&mut self, forest: &mut SetForest<K>) { |