diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-26 17:11:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 17:11:42 +0100 |
commit | 424b261532ef92d6d9e1d9156c52e657bfa1a37a (patch) | |
tree | 1034258f2089bba136115e1016052ca5fe30a903 /tests | |
parent | 7dcd05cdc187c6dcc9021e1bcb42098c165d3fb9 (diff) | |
parent | b3e39dd1752fa929c9ddb66e4d6d0625632ac676 (diff) |
Merge pull request #184 from matthiasbeyer/config-only-default-constructor
Remove Config::new()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/defaults.rs | 2 | ||||
-rw-r--r-- | tests/empty.rs | 4 | ||||
-rw-r--r-- | tests/errors.rs | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/tests/defaults.rs b/tests/defaults.rs index 8d863ae..5cb86f3 100644 --- a/tests/defaults.rs +++ b/tests/defaults.rs @@ -21,7 +21,7 @@ impl Default for Settings { #[test] fn set_defaults() { - let c = Config::new(); + let c = Config::default(); let s: Settings = c.try_into().expect("Deserialization failed"); assert_eq!(s.db_host, "default"); diff --git a/tests/empty.rs b/tests/empty.rs index 1f56d38..a763a1b 100644 --- a/tests/empty.rs +++ b/tests/empty.rs @@ -15,7 +15,9 @@ struct Settings { #[test] fn empty_deserializes() { - let s: Settings = Config::new().try_into().expect("Deserialization failed"); + let s: Settings = Config::default() + .try_into() + .expect("Deserialization failed"); assert_eq!(s.foo, 0); assert_eq!(s.bar, 0); } diff --git a/tests/errors.rs b/tests/errors.rs index 47dd050..c16ac9a 100644 --- a/tests/errors.rs +++ b/tests/errors.rs @@ -120,7 +120,7 @@ inner: test: ABC "#; - let mut cfg = Config::new(); + let mut cfg = Config::default(); cfg.merge(File::from_str(CFG, FileFormat::Yaml)).unwrap(); let e = cfg.try_into::<Outer>().unwrap_err(); if let ConfigError::Type { |