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

Function merge_option_json_map

crates/opencode-config/src/schema.rs:749–766  ·  view source on GitHub ↗
(
    target: &mut Option<HashMap<String, serde_json::Value>>,
    source: Option<HashMap<String, serde_json::Value>>,
)

Source from the content-addressed store, hash-verified

747}
748
749fn merge_option_json_map(
750 target: &mut Option<HashMap<String, serde_json::Value>>,
751 source: Option<HashMap<String, serde_json::Value>>,
752) {
753 if let Some(source_map) = source {
754 if let Some(target_map) = target {
755 for (key, source_value) in source_map {
756 if let Some(target_value) = target_map.get_mut(&key) {
757 merge_json_value(target_value, source_value);
758 } else {
759 target_map.insert(key, source_value);
760 }
761 }
762 } else {
763 *target = Some(source_map);
764 }
765 }
766}
767
768fn append_unique_keep_order(target: &mut Vec<String>, source: Vec<String>) {
769 for item in source {

Callers 1

deep_mergeMethod · 0.85

Calls 2

merge_json_valueFunction · 0.70
get_mutMethod · 0.45

Tested by

no test coverage detected