(file: &ParsedFile, line_index: &ImportLineIndex)
| 2654 | } |
| 2655 | |
| 2656 | fn import_shape_for_file(file: &ParsedFile, line_index: &ImportLineIndex) -> (usize, usize, usize) { |
| 2657 | let indexed = line_index.files.get(&file.path).or_else(|| { |
| 2658 | file.old_path |
| 2659 | .as_deref() |
| 2660 | .and_then(|old| line_index.files.get(old)) |
| 2661 | }); |
| 2662 | let current_lines = file |
| 2663 | .new_content |
| 2664 | .as_deref() |
| 2665 | .or(file.old_content.as_deref()) |
| 2666 | .map(count_line_units) |
| 2667 | .or_else(|| indexed.map(|idx| idx.lines.len())) |
| 2668 | .unwrap_or(0); |
| 2669 | let indexed_lines = indexed.map(|idx| idx.lines.len()).unwrap_or(0); |
| 2670 | let imported_commits = indexed.map(|idx| idx.imported_commits).unwrap_or(0); |
| 2671 | (current_lines, indexed_lines, imported_commits) |
| 2672 | } |
| 2673 | |
| 2674 | fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String { |
| 2675 | let mut entries: Vec<(usize, String)> = parsed |
no test coverage detected