Recursively merges `right` into a `left` JSON object; arrays and scalars are replaced.
(left: &mut Json, right: Json)
| 963 | |
| 964 | /// Recursively merges `right` into a `left` JSON object; arrays and scalars are replaced. |
| 965 | fn merge_json_value(left: &mut Json, right: Json) { |
| 966 | match (left, right) { |
| 967 | (Json::Object(left), Json::Object(right)) => { |
| 968 | for (key, value) in right { |
| 969 | match left.get_mut(&key) { |
| 970 | Some(existing) => merge_json_value(existing, value), |
| 971 | None => { |
| 972 | left.insert(key, value); |
| 973 | } |
| 974 | } |
| 975 | } |
| 976 | } |
| 977 | (left, right) => *left = right, |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | fn component_kind(component: &Json) -> Option<&str> { |
| 982 | component.get("kind").and_then(Json::as_str) |
no outgoing calls
no test coverage detected