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

Function truncate_column

atomic-cli/src/commands/session.rs:402–411  ·  view source on GitHub ↗
(value: &str, width: usize)

Source from the content-addressed store, hash-verified

400}
401
402fn truncate_column(value: &str, width: usize) -> String {
403 let count = value.chars().count();
404 if count <= width {
405 value.to_string()
406 } else if width <= 1 {
407 "…".to_string()
408 } else {
409 format!("{}…", value.chars().take(width - 1).collect::<String>())
410 }
411}
412
413fn todo_status_marker(status: &str) -> (&'static str, Option<&str>) {
414 match status.to_ascii_lowercase().as_str() {

Callers

nothing calls this directly

Calls 1

countMethod · 0.45

Tested by

no test coverage detected