(input: &str, max_chars: usize)
| 953 | } |
| 954 | |
| 955 | fn truncate_for_progress(input: &str, max_chars: usize) -> String { |
| 956 | let mut out = String::new(); |
| 957 | for (idx, ch) in input.chars().enumerate() { |
| 958 | if idx >= max_chars { |
| 959 | out.push_str("..."); |
| 960 | return out; |
| 961 | } |
| 962 | out.push(ch); |
| 963 | } |
| 964 | out |
| 965 | } |
| 966 | |
| 967 | fn format_byte_count(bytes: usize) -> String { |
| 968 | const KIB: f64 = 1024.0; |
no test coverage detected