(&mut self, id: LeafId)
| 623 | } |
| 624 | |
| 625 | fn del_leaf(&mut self, id: LeafId) -> Result<bool, Self::Error> { |
| 626 | if let Some(leaf) = self.leaves.remove(&id) { |
| 627 | if let Some(list) = self.branch_leaves.get_mut(&leaf.branch()) { |
| 628 | list.retain(|l| *l != id); |
| 629 | } |
| 630 | Ok(true) |
| 631 | } else { |
| 632 | Ok(false) |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | fn update_leaf_state(&mut self, id: LeafId, state: LeafState) -> Result<(), Self::Error> { |
| 637 | if let Some(leaf) = self.leaves.get_mut(&id) { |