Merge two JSON option maps, with `overlay` values taking precedence.
(
base: &HashMap<String, serde_json::Value>,
overlay: &HashMap<String, serde_json::Value>,
)
| 1788 | |
| 1789 | /// Merge two JSON option maps, with `overlay` values taking precedence. |
| 1790 | fn merge_json_maps( |
| 1791 | base: &HashMap<String, serde_json::Value>, |
| 1792 | overlay: &HashMap<String, serde_json::Value>, |
| 1793 | ) -> HashMap<String, serde_json::Value> { |
| 1794 | let mut result = base.clone(); |
| 1795 | for (k, v) in overlay { |
| 1796 | result.insert(k.clone(), v.clone()); |
| 1797 | } |
| 1798 | result |
| 1799 | } |
| 1800 | |
| 1801 | /// Convert a ConfigModel (from user config) into a ProviderModel, using an |
| 1802 | /// optional existing model as the base for defaults. |
no test coverage detected