Print rows of label-value pairs in a bordered table.
(rows: &[Vec<(&str, String)>], cell_width: usize, num_cols: usize)
| 442 | |
| 443 | /// Print rows of label-value pairs in a bordered table. |
| 444 | fn print_table_rows(rows: &[Vec<(&str, String)>], cell_width: usize, num_cols: usize) { |
| 445 | for row in rows { |
| 446 | print!("│"); |
| 447 | for (i, (label, value)) in row.iter().enumerate() { |
| 448 | if label.is_empty() { |
| 449 | print!("{}", " ".repeat(cell_width)); |
| 450 | } else { |
| 451 | print!("{}", format_cell(label, value, cell_width)); |
| 452 | } |
| 453 | print!("{}", if i < num_cols - 1 { "│" } else { "│\n" }); |
| 454 | } |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | pub fn print_gain_total(project: &str, range: &str, saved_tokens: u64, calls: u64, usd: f64) { |
| 459 | let saved_str = format_token_count(saved_tokens); |
no test coverage detected