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

Function merge_string_maps

crates/opencode-provider/src/bootstrap.rs:1997–2006  ·  view source on GitHub ↗

Merge two String->String maps, with `overlay` values taking precedence.

(
    base: &HashMap<String, String>,
    overlay: &HashMap<String, String>,
)

Source from the content-addressed store, hash-verified

1995
1996/// Merge two String->String maps, with `overlay` values taking precedence.
1997fn merge_string_maps(
1998 base: &HashMap<String, String>,
1999 overlay: &HashMap<String, String>,
2000) -> HashMap<String, String> {
2001 let mut result = base.clone();
2002 for (k, v) in overlay {
2003 result.insert(k.clone(), v.clone());
2004 }
2005 result
2006}
2007
2008/// Convert a ProviderState back to a ModelsProviderInfo for use by custom loaders.
2009/// Falls back to the original models.dev data when available.

Callers 1

config_to_provider_modelFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected