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

Idea: Ability to decode a sequence from single thing

Open vorner opened this issue 6 years ago • 0 comments

Hello

I was wondering if it would be more user friendly to be able to accept a single value in config where the structure expects a sequence. In other words, if I wanted config like this:

#[derive(Deserialize)]
struct Cfg {
  stuff: Vec<String>,
}

would it make sense to deserialize single-value vector from this yaml config?

stuff: Hello

config already gives some leeway in what it accepts in terms of key-name case, types, etc, presumably for user convenience.

vorner avatar Sep 01 '19 10:09 vorner