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

Method del_leaf

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

Source from the content-addressed store, hash-verified

571 }
572
573 fn del_leaf(&mut self, id: LeafId) -> Result<bool, Self::Error> {
574 if let Some(leaf) = self.leaves.remove(&id) {
575 if let Some(list) = self.branch_leaves.get_mut(&leaf.branch()) {
576 list.retain(|l| *l != id);
577 }
578 Ok(true)
579 } else {
580 Ok(false)
581 }
582 }
583
584 fn update_leaf_state(&mut self, id: LeafId, state: LeafState) -> Result<(), Self::Error> {
585 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