Update statistics based on hunks.
(&mut self)
| 638 | |
| 639 | /// Update statistics based on hunks. |
| 640 | pub fn compute_stats(&mut self) { |
| 641 | let mut insertions = 0; |
| 642 | let mut deletions = 0; |
| 643 | |
| 644 | for graph_op in &self.hunks { |
| 645 | for line in &graph_op.lines { |
| 646 | match line.status { |
| 647 | LineStatus::Added => insertions += 1, |
| 648 | LineStatus::Removed => deletions += 1, |
| 649 | LineStatus::Unchanged => {} |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | self.stats.insertions = insertions; |
| 655 | self.stats.deletions = deletions; |
| 656 | } |
| 657 | |
| 658 | /// Get the display path for the file. |
| 659 | pub fn display_path(&self) -> &str { |
no outgoing calls
no test coverage detected