(input: &str, max_chars: usize)
| 909 | } |
| 910 | |
| 911 | fn truncate_for_progress(input: &str, max_chars: usize) -> String { |
| 912 | let mut out = String::new(); |
| 913 | for (idx, ch) in input.chars().enumerate() { |
| 914 | if idx >= max_chars { |
| 915 | out.push_str("..."); |
| 916 | return out; |
| 917 | } |
| 918 | out.push(ch); |
| 919 | } |
| 920 | out |
| 921 | } |
| 922 | |
| 923 | fn format_byte_count(bytes: usize) -> String { |
| 924 | const KIB: f64 = 1024.0; |
no test coverage detected