Function
truncate_column
(value: &str, width: usize)
Source from the content-addressed store, hash-verified
| 456 | } |
| 457 | |
| 458 | fn truncate_column(value: &str, width: usize) -> String { |
| 459 | let count = value.chars().count(); |
| 460 | if count <= width { |
| 461 | value.to_string() |
| 462 | } else if width <= 1 { |
| 463 | "…".to_string() |
| 464 | } else { |
| 465 | format!("{}…", value.chars().take(width - 1).collect::<String>()) |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | fn todo_status_marker(status: &str) -> (&'static str, Option<&str>) { |
| 470 | match status.to_ascii_lowercase().as_str() { |
Callers
nothing calls this directly
Tested by
no test coverage detected