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

Method leaf

atomic-core/src/change/ops.rs:362–370  ·  view source on GitHub ↗
(
            id: &mut LeafId,
            f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
        )

Source from the content-addressed store, hash-verified

360 Ok(())
361 }
362 fn leaf<E>(
363 id: &mut LeafId,
364 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
365 ) -> Result<(), E> {
366 if !id.change_id().is_root() {
367 *id = LeafId::new(f(id.change_id())?, id.leaf_idx());
368 }
369 Ok(())
370 }
371 fn leaves<E>(
372 ops: &mut [LeafOp],
373 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,

Callers

nothing calls this directly

Calls 3

leaf_idxMethod · 0.80
is_rootMethod · 0.45
change_idMethod · 0.45

Tested by

no test coverage detected