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

Method leaf

atomic-core/src/change/ops.rs:347–355  ·  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

345 Ok(())
346 }
347 fn leaf<E>(
348 id: &mut LeafId,
349 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
350 ) -> Result<(), E> {
351 if !id.change_id().is_root() {
352 *id = LeafId::new(f(id.change_id())?, id.leaf_idx());
353 }
354 Ok(())
355 }
356 fn leaves<E>(
357 ops: &mut [LeafOp],
358 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