Comma-join up to [`WALKTHROUGH_LIST_CAP`] items, eliding the rest.
(items: &[String])
| 154 | |
| 155 | /// Comma-join up to [`WALKTHROUGH_LIST_CAP`] items, eliding the rest. |
| 156 | fn capped_list(items: &[String]) -> String { |
| 157 | if items.len() <= WALKTHROUGH_LIST_CAP { |
| 158 | items.join(", ") |
| 159 | } else { |
| 160 | format!( |
| 161 | "{}, … and {} more", |
| 162 | items[..WALKTHROUGH_LIST_CAP].join(", "), |
| 163 | items.len() - WALKTHROUGH_LIST_CAP |
| 164 | ) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /// Render the guided walkthrough as bounded text: a verdict line, then one |
| 169 | /// numbered entry per layer — title, rationale, files, contributing changes |