(
total: usize,
infos: &std::collections::BTreeMap<String, usize>,
)
| 924 | } |
| 925 | |
| 926 | fn format_hunk_aggregate_info( |
| 927 | total: usize, |
| 928 | infos: &std::collections::BTreeMap<String, usize>, |
| 929 | ) -> String { |
| 930 | if total == 1 { |
| 931 | return infos |
| 932 | .keys() |
| 933 | .next() |
| 934 | .cloned() |
| 935 | .unwrap_or_else(|| "(1 hunk)".to_string()); |
| 936 | } |
| 937 | |
| 938 | let details = infos |
| 939 | .iter() |
| 940 | .map(|(info, count)| format!("{}x {}", count, trim_hunk_info(info))) |
| 941 | .collect::<Vec<_>>() |
| 942 | .join("; "); |
| 943 | format!("({} hunks: {})", total, details) |
| 944 | } |
| 945 | |
| 946 | fn trim_hunk_info(info: &str) -> &str { |
| 947 | info.strip_prefix('(') |
no test coverage detected