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

Function merge_state_component

atomic-repository/src/repository/operation.rs:4505–4520  ·  view source on GitHub ↗
(
    base: &Option<T>,
    after: &Option<T>,
    merged: &mut Option<T>,
    changed: &mut bool,
)

Source from the content-addressed store, hash-verified

4503}
4504
4505fn merge_state_component<T: Clone + PartialEq>(
4506 base: &Option<T>,
4507 after: &Option<T>,
4508 merged: &mut Option<T>,
4509 changed: &mut bool,
4510) -> bool {
4511 if after == base {
4512 return true;
4513 }
4514 if *changed {
4515 return false;
4516 }
4517 *merged = after.clone();
4518 *changed = true;
4519 true
4520}
4521
4522fn operation_write_sets_are_disjoint(operations: &[Operation]) -> bool {
4523 let mut metadata_targets = BTreeSet::<MetadataTarget>::new();

Callers 1

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected