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

Method old_pos

atomic-repository/src/diff_engine.rs:783–790  ·  view source on GitHub ↗

Old-file position: the line number for removals, or the insertion boundary (the number of the preceding old line) for additions.

(&self)

Source from the content-addressed store, hash-verified

781 /// Old-file position: the line number for removals, or the insertion
782 /// boundary (the number of the preceding old line) for additions.
783 fn old_pos(&self) -> usize {
784 match self.line.status {
785 LineStatus::Removed => self.line.old_line_num.unwrap_or(1),
786 _ => {
787 (self.line.new_line_num.unwrap_or(1) as isize - 1 - self.net_before).max(0) as usize
788 }
789 }
790 }
791
792 /// New-file position: the line number for additions, or the deletion
793 /// boundary (the number of the preceding new line) for removals.

Callers 1

hunks_from_changed_linesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected