Function
insert_opt_value
(obj: &mut serde_json::Map<String, Value>, key: &str, value: Option<Value>)
Source from the content-addressed store, hash-verified
| 2345 | } |
| 2346 | |
| 2347 | fn insert_opt_value(obj: &mut serde_json::Map<String, Value>, key: &str, value: Option<Value>) { |
| 2348 | if let Some(value) = value { |
| 2349 | obj.insert(key.to_string(), value); |
| 2350 | } |
| 2351 | } |
| 2352 | |
| 2353 | fn parse_json_or_string(raw: String) -> Value { |
| 2354 | serde_json::from_str::<Value>(&raw).unwrap_or_else(|_| Value::String(raw)) |
Tested by
no test coverage detected