Add a built graph_op to the result.
(&mut self, graph_op: BuiltHunk)
| 411 | |
| 412 | /// Add a built graph_op to the result. |
| 413 | pub fn add_hunk(&mut self, graph_op: BuiltHunk) { |
| 414 | // Update statistics |
| 415 | if let Some((start, end)) = graph_op.content_range() { |
| 416 | // Rough estimate: count newlines would be better but this is a proxy |
| 417 | self.lines_inserted += (end - start) as usize; |
| 418 | } |
| 419 | self.lines_deleted += graph_op.deleted_line_count(); |
| 420 | |
| 421 | self.hunks.push(graph_op); |
| 422 | } |
| 423 | |
| 424 | /// Record that hunks were combined. |
| 425 | pub fn record_combination(&mut self) { |