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

Method new_pos

atomic-cli/src/commands/diff/helpers.rs:58–65  ·  view source on GitHub ↗

New-file position: the line number for additions, or the deletion boundary (the number of the preceding new line) for removals.

(&self)

Source from the content-addressed store, hash-verified

56 /// New-file position: the line number for additions, or the deletion
57 /// boundary (the number of the preceding new line) for removals.
58 fn new_pos(&self) -> usize {
59 match self.line.status {
60 LineStatus::Added => self.line.new_line_num.unwrap_or(1),
61 _ => {
62 (self.line.old_line_num.unwrap_or(1) as isize - 1 + self.net_before).max(0) as usize
63 }
64 }
65 }
66}
67
68impl Diff {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected