(
total: usize,
infos: &std::collections::BTreeMap<String, usize>,
)
| 947 | } |
| 948 | |
| 949 | fn format_hunk_aggregate_info( |
| 950 | total: usize, |
| 951 | infos: &std::collections::BTreeMap<String, usize>, |
| 952 | ) -> String { |
| 953 | if total == 1 { |
| 954 | return infos |
| 955 | .keys() |
| 956 | .next() |
| 957 | .cloned() |
| 958 | .unwrap_or_else(|| "(1 hunk)".to_string()); |
| 959 | } |
| 960 | |
| 961 | let details = infos |
| 962 | .iter() |
| 963 | .map(|(info, count)| format!("{}x {}", count, trim_hunk_info(info))) |
| 964 | .collect::<Vec<_>>() |
| 965 | .join("; "); |
| 966 | format!("({} hunks: {})", total, details) |
| 967 | } |
| 968 | |
| 969 | fn trim_hunk_info(info: &str) -> &str { |
| 970 | info.strip_prefix('(') |
no test coverage detected