diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-19 10:17:33 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-03-26 17:01:26 +0100 |
commit | b3e39dd1752fa929c9ddb66e4d6d0625632ac676 (patch) | |
tree | 64107176933afeee92823712ac4497cfe2adbf69 /src/config.rs | |
parent | 20d37720b0342e68cd3c8c2c2a437b8634ec3642 (diff) |
Remove Config::new()
Removes the ::new() constructor, because Config::default() does the
same.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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<T>(&mut self, source: T) -> Result<&mut Config> where |