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

Method new_pos

atomic-cli/src/commands/diff/helpers.rs:62–69  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected