(input: &str, max_chars: usize)
| 2833 | } |
| 2834 | |
| 2835 | fn truncate_for_progress(input: &str, max_chars: usize) -> String { |
| 2836 | let mut out = String::new(); |
| 2837 | for (idx, ch) in input.chars().enumerate() { |
| 2838 | if idx >= max_chars { |
| 2839 | out.push_str("..."); |
| 2840 | return out; |
| 2841 | } |
| 2842 | out.push(ch); |
| 2843 | } |
| 2844 | out |
| 2845 | } |
| 2846 | |
| 2847 | fn format_byte_count(bytes: usize) -> String { |
| 2848 | const KIB: f64 = 1024.0; |
no test coverage detected