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

Vector fields are overwritten instead of merged

Open dhruvkb opened this issue 2 years ago • 4 comments

Consider the following config.

struct Conf {
	nums: Vec<i32>
}

This is built and given two config files.

# a.yml
nums:
- 1
- 2
# b.yml
nums:
- 3
- 4

The output of this configuration is that nums has only [3, 4]. Vectors should be merged, and nums should contain [1, 2, 3, 4].

dhruvkb avatar Apr 14 '23 00:04 dhruvkb

Hi,

thanks for your report. I don't think lists should be merged necessarily, but I see that in some instances, users might want to merge lists.

matthiasbeyer avatar Apr 14 '23 05:04 matthiasbeyer

If not the predominant default behaviour, at least an option or workaround to merge lists would be great to have. Thanks for considering this.

dhruvkb avatar Apr 14 '23 21:04 dhruvkb