(bytes: usize)
| 2189 | } |
| 2190 | |
| 2191 | fn human_bytes(bytes: usize) -> String { |
| 2192 | const KIB: usize = 1024; |
| 2193 | const MIB: usize = 1024 * 1024; |
| 2194 | if bytes >= MIB { |
| 2195 | format!("{:.1} MiB", bytes as f64 / MIB as f64) |
| 2196 | } else if bytes >= KIB { |
| 2197 | format!("{:.1} KiB", bytes as f64 / KIB as f64) |
| 2198 | } else { |
| 2199 | format!("{bytes} B") |
| 2200 | } |
| 2201 | } |
| 2202 | |
| 2203 | fn user_facing_run_error(error: &str) -> String { |
| 2204 | let Some(rest) = error.strip_prefix("no API key for provider: ") else { |
no outgoing calls
no test coverage detected