Count unique paths affected by hunks.
(hunks: &[GraphOp<H>])
| 540 | |
| 541 | /// Count unique paths affected by hunks. |
| 542 | pub(crate) fn count_unique_paths<H>(hunks: &[GraphOp<H>]) -> usize { |
| 543 | let mut paths = std::collections::HashSet::new(); |
| 544 | for graph_op in hunks { |
| 545 | if let Some(path) = get_hunk_path(graph_op) { |
| 546 | paths.insert(path); |
| 547 | } |
| 548 | } |
| 549 | paths.len() |
| 550 | } |
| 551 | |
| 552 | /// Get the path from a graph_op. |
| 553 | fn get_hunk_path<H>(graph_op: &GraphOp<H>) -> Option<String> { |
nothing calls this directly
no test coverage detected