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

Method modify

atomic-core/src/record/workflow/crdt/builder/branch.rs:117–129  ·  view source on GitHub ↗

Creates a line modify operation (old content → new content). This is the canonical representation for a modified line. Carries both old and new content so every consumer can render word-level diffs without heuristic re-pairing.

(branch_id: BranchId, old_content: Vec<LeafOp>, new_content: Vec<LeafOp>)

Source from the content-addressed store, hash-verified

115 /// both old and new content so every consumer can render word-level
116 /// diffs without heuristic re-pairing.
117 pub fn modify(branch_id: BranchId, old_content: Vec<LeafOp>, new_content: Vec<LeafOp>) -> Self {
118 Self {
119 branch_id,
120 operation: BranchOp::Modify {
121 branch: branch_id,
122 old_content,
123 new_content,
124 },
125 token_ops: Vec::new(),
126 old_line_num: None,
127 new_line_num: None,
128 }
129 }
130
131 /// Returns `true` if this is a delete operation.
132 #[inline]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected