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

Function format_setting_value

crates/openshell-cli/src/run.rs:6263–6273  ·  view source on GitHub ↗
(value: Option<&SettingValue>)

Source from the content-addressed store, hash-verified

6261}
6262
6263fn format_setting_value(value: Option<&SettingValue>) -> String {
6264 let Some(value) = value.and_then(|v| v.value.as_ref()) else {
6265 return "<unset>".to_string();
6266 };
6267 match value {
6268 setting_value::Value::StringValue(v) => v.clone(),
6269 setting_value::Value::BoolValue(v) => v.to_string(),
6270 setting_value::Value::IntValue(v) => v.to_string(),
6271 setting_value::Value::BytesValue(v) => format!("<bytes:{}>", v.len()),
6272 }
6273}
6274
6275fn short_hash(hash: &str) -> &str {
6276 if hash.len() >= 12 { &hash[..12] } else { hash }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected