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

Function truncate_status_field

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

Source from the content-addressed store, hash-verified

5424}
5425
5426fn truncate_status_field(value: &str, max_chars: usize) -> String {
5427 if value.is_empty() {
5428 return "-".to_string();
5429 }
5430 let mut chars = value.chars();
5431 let truncated = chars.by_ref().take(max_chars).collect::<String>();
5432 if chars.next().is_some() {
5433 format!("{truncated}...")
5434 } else {
5435 truncated
5436 }
5437}
5438
5439fn provider_refresh_strategy_name(strategy: ProviderCredentialRefreshStrategy) -> &'static str {
5440 match strategy {

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected