Convert a JSON value to a display string. - Strings: returned as-is (no quotes) - Null: empty string - Numbers/Bools: `.to_string()` - Objects/Arrays: JSON serialization
(v: &serde_json::Value)
| 88 | /// - Numbers/Bools: `.to_string()` |
| 89 | /// - Objects/Arrays: JSON serialization |
| 90 | pub fn json_to_display_string(v: &serde_json::Value) -> String { |
| 91 | match v { |
| 92 | serde_json::Value::String(s) => s.clone(), |
| 93 | serde_json::Value::Null => String::new(), |
| 94 | serde_json::Value::Number(n) => n.to_string(), |
| 95 | serde_json::Value::Bool(b) => b.to_string(), |
| 96 | other => other.to_string(), |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | /// Convert a f64 to a JSON number, preferring integer representation. |
| 101 | /// |
no test coverage detected