Old-file position: the line number for removals, or the insertion boundary (the number of the preceding old line) for additions.
(&self)
| 49 | /// Old-file position: the line number for removals, or the insertion |
| 50 | /// boundary (the number of the preceding old line) for additions. |
| 51 | fn old_pos(&self) -> usize { |
| 52 | match self.line.status { |
| 53 | LineStatus::Removed => self.line.old_line_num.unwrap_or(1), |
| 54 | _ => { |
| 55 | (self.line.new_line_num.unwrap_or(1) as isize - 1 - self.net_before).max(0) as usize |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /// New-file position: the line number for additions, or the deletion |
| 61 | /// boundary (the number of the preceding new line) for removals. |
no outgoing calls
no test coverage detected