(&mut self, id: LeafId)
| 214 | } |
| 215 | |
| 216 | fn del_leaf(&mut self, id: LeafId) -> Result<bool, Self::Error> { |
| 217 | if let Some(leaf) = self.leaves.remove(&id) { |
| 218 | if let Some(leaves) = self.branch_leaves.get_mut(&leaf.branch()) { |
| 219 | leaves.retain(|l| *l != id); |
| 220 | } |
| 221 | Ok(true) |
| 222 | } else { |
| 223 | Ok(false) |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | fn update_leaf_state(&mut self, id: LeafId, state: LeafState) -> Result<(), Self::Error> { |
| 228 | if let Some(leaf) = self.leaves.get_mut(&id) { |