MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / del_leaf

Method del_leaf

atomic-core/src/crdt/apply/traits.rs:630–639  ·  view source on GitHub ↗
(&mut self, id: LeafId)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

get_mutMethod · 0.80
removeMethod · 0.65
branchMethod · 0.45

Tested by

no test coverage detected