Leaf methods
(&mut self, leaf: &Leaf, _after: Option<LeafId>)
| 553 | |
| 554 | // Leaf methods |
| 555 | fn put_leaf(&mut self, leaf: &Leaf, _after: Option<LeafId>) -> Result<bool, Self::Error> { |
| 556 | let is_new = !self.leaves.contains_key(&leaf.id()); |
| 557 | self.leaves.insert(leaf.id(), leaf.clone()); |
| 558 | self.branch_leaves |
| 559 | .entry(leaf.branch()) |
| 560 | .or_default() |
| 561 | .push(leaf.id()); |
| 562 | Ok(is_new) |
| 563 | } |
| 564 | |
| 565 | fn get_leaf(&self, id: LeafId) -> Result<Option<Leaf>, Self::Error> { |
| 566 | Ok(self.leaves.get(&id).cloned()) |
no test coverage detected