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

Method del_leaf

atomic-core/tests/crdt_integration_test.rs:216–225  ·  view source on GitHub ↗
(&mut self, id: LeafId)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

get_mutMethod · 0.80
removeMethod · 0.65
branchMethod · 0.45

Tested by

no test coverage detected