Skip to main content

chunk_your_tools/
json_util.rs

1use serde_json::Value;
2
3/// Stringify a JSON value for IDs, names, and display (matches Python `str()` on scalars).
4#[must_use]
5pub fn value_to_string(v: &Value) -> String {
6    match v {
7        Value::String(s) => s.clone(),
8        Value::Number(n) => n.to_string(),
9        Value::Bool(b) => b.to_string(),
10        other => other.to_string(),
11    }
12}