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

Method branch

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

Source from the content-addressed store, hash-verified

336 Ok(())
337 }
338 fn branch<E>(
339 id: &mut BranchId,
340 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
341 ) -> Result<(), E> {
342 if !id.change_id().is_root() {
343 *id = BranchId::new(f(id.change_id())?, id.branch_idx());
344 }
345 Ok(())
346 }
347 fn leaf<E>(
348 id: &mut LeafId,
349 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,

Callers

nothing calls this directly

Calls 3

branch_idxMethod · 0.80
is_rootMethod · 0.45
change_idMethod · 0.45

Tested by

no test coverage detected