config-rs icon indicating copy to clipboard operation
config-rs copied to clipboard

Option to overwrite rather than merge HashMaps

Open aeheathc opened this issue 1 year ago • 0 comments

I have multiple config sources. For most data types, when a field is available from multiple sources, there's an order of precedence for which one to use. However, one of the fields in my settings struct is a HashMap. I have found that when this field is available from multiple config settings, the HashMaps are merged together, where keys from both sources are present in the deserialized output. I would prefer that one whole HashMap overrides another, to bring the behavior in line with that of the primitive types. Or, at least have an option I can call on the ConfigBuilder to ask for this behavior.

aeheathc avatar Apr 01 '23 23:04 aeheathc