MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / truncate_display

Function truncate_display

crates/openshell-cli/src/run.rs:5629–5638  ·  view source on GitHub ↗
(value: &str, max_width: usize)

Source from the content-addressed store, hash-verified

5627}
5628
5629fn truncate_display(value: &str, max_width: usize) -> String {
5630 if value.chars().count() <= max_width {
5631 return value.to_string();
5632 }
5633
5634 let keep = max_width.saturating_sub(3);
5635 let mut truncated = value.chars().take(keep).collect::<String>();
5636 truncated.push_str("...");
5637 truncated
5638}
5639
5640pub async fn provider_update(
5641 server: &str,

Callers 1

print_provider_type_rowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected