MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / capped_list

Function capped_list

atomic-cli/src/commands/triage/output.rs:156–166  ·  view source on GitHub ↗

Comma-join up to [`WALKTHROUGH_LIST_CAP`] items, eliding the rest.

(items: &[String])

Source from the content-addressed store, hash-verified

154
155/// Comma-join up to [`WALKTHROUGH_LIST_CAP`] items, eliding the rest.
156fn 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

Callers 1

Calls 1

lenMethod · 0.45

Tested by 1