config-rs v0.7.0 Release Notes
Release Date: 2017-08-05 // over 6 years ago-
Fix conflict with
serde_yaml
. #39Implement
Source
forConfig
.Implement
serde::de::Deserializer
forConfig
.my_config.deserialize
may now be called as eitherDeserialize::deserialize(my_config)
ormy_config.try_into()
.Remove
ConfigResult
. The builder pattern requires either.try_into
as the final step or the initialConfig::new()
to be bound to a slot. Errors must also be handled on each call instead of at the end of the chain.let mut c = Config::new(); c .merge(File::with_name("Settings")).unwrap() .merge(Environment::with_prefix("APP")).unwrap();
let c = Config::new() .merge(File::with_name("Settings")).unwrap() .merge(Environment::with_prefix("APP")).unwrap() // LLVM should be smart enough to remove the actual clone operation // as you are cloning a temporary that is dropped at the same time .clone();
let mut s: Settings = Config::new() .merge(File::with_name("Settings")).unwrap() .merge(Environment::with_prefix("APP")).unwrap() .try_into();