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