Merge another stats into this one.
(&mut self, other: &CreditStats)
| 516 | |
| 517 | /// Merge another stats into this one. |
| 518 | pub fn merge(&mut self, other: &CreditStats) { |
| 519 | self.total_lines += other.total_lines; |
| 520 | self.human_lines += other.human_lines; |
| 521 | self.ai_assisted_lines += other.ai_assisted_lines; |
| 522 | self.collaborative_lines += other.collaborative_lines; |
| 523 | self.ai_generated_lines += other.ai_generated_lines; |
| 524 | self.unknown_lines += other.unknown_lines; |
| 525 | |
| 526 | for vendor in &other.ai_vendors { |
| 527 | if !self.ai_vendors.contains(vendor) { |
| 528 | self.ai_vendors.push(vendor.clone()); |
| 529 | } |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | impl fmt::Display for CreditStats { |