Move this cursor to `elem`. If `elem` is in the set, place the cursor at `elem` and return true. If `elem` is not in the set, place the cursor at the next larger element (or the end) and return false.
(&mut self, elem: K)
| 263 | /// If `elem` is not in the set, place the cursor at the next larger element (or the end) and |
| 264 | /// return false. |
| 265 | pub fn goto(&mut self, elem: K) -> bool { |
| 266 | match self.root.expand() { |
| 267 | None => false, |
| 268 | Some(root) => { |
| 269 | if self.path.find(elem, root, self.pool, self.comp).is_some() { |
| 270 | true |
| 271 | } else { |
| 272 | self.path.normalize(self.pool); |
| 273 | false |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | /// Move this cursor to the first element. |
| 280 | pub fn goto_first(&mut self) -> Option<K> { |