config-rs
config-rs copied to clipboard
Can't parse an empty array with the env parser
I am trying to parse a vec key with Env (with env TEST_KEY__LIST = "") source like
Environment::with_prefix("TEST")
.try_parsing(true)
.prefix_separator("_")
.separator("__")
.list_separator(",")
.with_list_parse_key("test_key.enable")
struct Config {
test_key: TestKey
}
enum Test {
One,
Two
}
struct TestKey {
enable: Vec<Test>
}
and I see
invalid type: string "", expected a sequence
I assume that the empty string should be parsed as an empty array