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

Method modify

atomic-core/src/change/ops.rs:739–751  ·  view source on GitHub ↗

Creates a line modify operation (old content → new content). This is the canonical representation for a modified line. Both old and new line numbers should be set via the builder methods. # Arguments `branch_id` - The branch (line) being modified `old_content` - Tokens of the line before the change `new_content` - Tokens of the line after the change

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

Source from the content-addressed store, hash-verified

737 /// * `old_content` - Tokens of the line before the change
738 /// * `new_content` - Tokens of the line after the change
739 pub fn modify(branch_id: BranchId, old_content: Vec<LeafOp>, new_content: Vec<LeafOp>) -> Self {
740 Self {
741 branch_id,
742 operation: BranchOp::Modify {
743 branch: branch_id,
744 old_content,
745 new_content,
746 },
747 old_line_num: None,
748 new_line_num: None,
749 content_range: None,
750 }
751 }
752
753 /// Creates a line modify operation with line numbers.
754 pub fn modify_at(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected