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

Method modify_at

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

Creates a line modify operation with line numbers.

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

Source from the content-addressed store, hash-verified

752
753 /// Creates a line modify operation with line numbers.
754 pub fn modify_at(
755 branch_id: BranchId,
756 old_content: Vec<LeafOp>,
757 new_content: Vec<LeafOp>,
758 old_line_num: usize,
759 new_line_num: usize,
760 ) -> Self {
761 Self {
762 branch_id,
763 operation: BranchOp::Modify {
764 branch: branch_id,
765 old_content,
766 new_content,
767 },
768 old_line_num: Some(old_line_num),
769 new_line_num: Some(new_line_num),
770 content_range: None,
771 }
772 }
773
774 /// Set the old line number.
775 pub fn with_old_line_num(mut self, line_num: usize) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected