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

Method trunk

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

Source from the content-addressed store, hash-verified

327 mut remap: impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
328 ) -> Result<(), E> {
329 fn trunk<E>(
330 id: &mut TrunkId,
331 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
332 ) -> Result<(), E> {
333 if !id.change_id().is_root() {
334 *id = TrunkId::new(f(id.change_id())?, id.file_idx());
335 }
336 Ok(())
337 }
338 fn branch<E>(
339 id: &mut BranchId,
340 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,

Callers

nothing calls this directly

Calls 3

file_idxMethod · 0.80
is_rootMethod · 0.45
change_idMethod · 0.45

Tested by

no test coverage detected