Compute cell width from the widest node-kind entry, capped at `MAX_CELL_WIDTH`.
(sorted_kinds: &[(&String, &u64)])
| 205 | |
| 206 | /// Compute cell width from the widest node-kind entry, capped at `MAX_CELL_WIDTH`. |
| 207 | fn compute_cell_width(sorted_kinds: &[(&String, &u64)]) -> usize { |
| 208 | let max_kind_len = sorted_kinds |
| 209 | .iter() |
| 210 | .map(|(k, _)| k.len()) |
| 211 | .max() |
| 212 | .unwrap_or(10); |
| 213 | let max_count_len = sorted_kinds |
| 214 | .iter() |
| 215 | .map(|(_, c)| format_number(**c).len()) |
| 216 | .max() |
| 217 | .unwrap_or(5); |
| 218 | (max_kind_len + max_count_len + 3).clamp(22, MAX_CELL_WIDTH) |
| 219 | } |
| 220 | |
| 221 | /// Print the top title row: version (left) + country flags (right). |
| 222 | /// Returns a shuffled copy of `flags` using xorshift64 seeded from time + PID. |
no test coverage detected