Format an `EffectiveSetting` value for log display.
(es: &openshell_core::proto::EffectiveSetting)
| 1939 | |
| 1940 | /// Format an `EffectiveSetting` value for log display. |
| 1941 | fn format_setting_value(es: &openshell_core::proto::EffectiveSetting) -> String { |
| 1942 | use openshell_core::proto::setting_value; |
| 1943 | match es.value.as_ref().and_then(|sv| sv.value.as_ref()) { |
| 1944 | None => "<unset>".to_string(), |
| 1945 | Some(setting_value::Value::StringValue(v)) => v.clone(), |
| 1946 | Some(setting_value::Value::BoolValue(v)) => v.to_string(), |
| 1947 | Some(setting_value::Value::IntValue(v)) => v.to_string(), |
| 1948 | Some(setting_value::Value::BytesValue(_)) => "<bytes>".to_string(), |
| 1949 | } |
| 1950 | } |
| 1951 | |
| 1952 | #[cfg(test)] |
| 1953 | #[allow( |
no outgoing calls
no test coverage detected