From b3e39dd1752fa929c9ddb66e4d6d0625632ac676 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 19 Mar 2021 10:17:33 +0100 Subject: Remove Config::new() Removes the ::new() constructor, because Config::default() does the same. Signed-off-by: Matthias Beyer --- src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index cfd865a..94658da 100644 --- a/src/config.rs +++ b/src/config.rs @@ -39,7 +39,7 @@ impl Default for ConfigKind { /// A prioritized configuration repository. It maintains a set of /// configuration sources, fetches values to populate those, and provides /// them according to the source's priority. -#[derive(Default, Clone, Debug)] +#[derive(Clone, Debug)] pub struct Config { kind: ConfigKind, @@ -47,16 +47,16 @@ pub struct Config { pub cache: Value, } -impl Config { - pub fn new() -> Self { - Self { +impl Default for Config { + fn default() -> Self { + Config { kind: ConfigKind::default(), - // Config root should be instantiated as an empty table - // to avoid deserialization errors. cache: Value::new(None, Table::new()), } } +} +impl Config { /// Merge in a configuration property source. pub fn merge(&mut self, source: T) -> Result<&mut Config> where -- cgit v1.2.3