(input: &str, max_chars: usize)
| 901 | } |
| 902 | |
| 903 | fn truncate_for_progress(input: &str, max_chars: usize) -> String { |
| 904 | let mut out = String::new(); |
| 905 | for (idx, ch) in input.chars().enumerate() { |
| 906 | if idx >= max_chars { |
| 907 | out.push_str("..."); |
| 908 | return out; |
| 909 | } |
| 910 | out.push(ch); |
| 911 | } |
| 912 | out |
| 913 | } |
| 914 | |
| 915 | fn format_byte_count(bytes: usize) -> String { |
| 916 | const KIB: f64 = 1024.0; |
no test coverage detected