MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / insert_opt_value

Function insert_opt_value

crates/opencode-provider/src/responses.rs:2347–2351  ·  view source on GitHub ↗
(obj: &mut serde_json::Map<String, Value>, key: &str, value: Option<Value>)

Source from the content-addressed store, hash-verified

2345}
2346
2347fn 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
2353fn parse_json_or_string(raw: String) -> Value {
2354 serde_json::from_str::<Value>(&raw).unwrap_or_else(|_| Value::String(raw))

Callers 1

get_argsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected