You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let defaults = Config::try_from(&MyConfig::default())?;Config::builder().add_source(defaults).add_source(config::File::with_name("config.toml")).build()?
Suppose I have this config struct
I want to produce a
MyConfig
, where values explicitly set inconfig.toml
are used, otherwise, the default implementation is used.Something like
But I couldn't figure out a way to do this. This seems like a very common use case, so I feel like I'm missing something.
The text was updated successfully, but these errors were encountered: