(input: &str, max_chars: usize)
| 840 | } |
| 841 | |
| 842 | fn truncate_for_progress(input: &str, max_chars: usize) -> String { |
| 843 | let mut out = String::new(); |
| 844 | for (idx, ch) in input.chars().enumerate() { |
| 845 | if idx >= max_chars { |
| 846 | out.push_str("..."); |
| 847 | return out; |
| 848 | } |
| 849 | out.push(ch); |
| 850 | } |
| 851 | out |
| 852 | } |
| 853 | |
| 854 | fn format_byte_count(bytes: usize) -> String { |
| 855 | const KIB: f64 = 1024.0; |
no test coverage detected