Try to insert `key` into the set. If the set did not contain `key`, insert it and return true. If `key` is already present, don't change the set and return false.
(
&mut self,
key: K,
forest: &mut SetForest<K>,
comp: &C,
)
| 105 | /// |
| 106 | /// If `key` is already present, don't change the set and return false. |
| 107 | pub fn insert<C: Comparator<K>>( |
| 108 | &mut self, |
| 109 | key: K, |
| 110 | forest: &mut SetForest<K>, |
| 111 | comp: &C, |
| 112 | ) -> bool { |
| 113 | self.cursor(forest, comp).insert(key) |
| 114 | } |
| 115 | |
| 116 | /// Like `insert` but returns an error on allocation failure. |
| 117 | pub fn try_insert<C: Comparator<K>>( |
no test coverage detected