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

Method update_trunk_path

atomic-core/src/crdt/apply/trunk.rs:432–439  ·  view source on GitHub ↗
(&mut self, id: TrunkId, new_path: &str)

Source from the content-addressed store, hash-verified

430 }
431
432 fn update_trunk_path(&mut self, id: TrunkId, new_path: &str) -> Result<(), Self::Error> {
433 if let Some(trunk) = self.trunks.get_mut(&id) {
434 self.path_index.remove(trunk.path());
435 trunk.set_path(new_path.to_string());
436 self.path_index.insert(new_path.to_string(), id);
437 }
438 Ok(())
439 }
440
441 fn get_trunk_by_path(&self, path: &str) -> Result<Option<TrunkId>, Self::Error> {
442 Ok(self.path_index.get(path).copied())

Callers 1

apply_moveFunction · 0.45

Calls 5

get_mutMethod · 0.80
set_pathMethod · 0.80
removeMethod · 0.65
pathMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected