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

Method del_leaf

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

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 3

get_mutMethod · 0.80
removeMethod · 0.65
branchMethod · 0.45

Tested by

no test coverage detected