diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-14 09:59:36 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-03-14 09:59:36 +0100 |
commit | def3702fac13605af303b8319af15943cc7ff8e5 (patch) | |
tree | 8d745347c365c6e21a44843be88d72cabd3b07dc /src/config.rs | |
parent | 48db2a16e892c3a21ada014fb8e163b33bcb483b (diff) | |
parent | c26a941541ccd7733f7533372da71f0a5be36ed5 (diff) |
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs index 1019061..99216ad 100644 --- a/src/config.rs +++ b/src/config.rs @@ -227,20 +227,20 @@ impl Config { } /// Attempt to deserialize the entire configuration into the requested type. - pub fn try_into<'de, T: Deserialize<'de>>(self) -> Result<T> { + pub fn try_deserialize<'de, T: Deserialize<'de>>(self) -> Result<T> { T::deserialize(self) } /// Attempt to serialize the entire configuration from the given type. - pub fn try_from<T: Serialize>(from: &T) -> Result<Self> { + pub fn try_serialize<T: Serialize>(from: &T) -> Result<Self> { let mut serializer = ConfigSerializer::default(); from.serialize(&mut serializer)?; Ok(serializer.output) } - #[deprecated(since = "0.7.0", note = "please use 'try_into' instead")] + #[deprecated(since = "0.7.0", note = "please use 'try_deserialize' instead")] pub fn deserialize<'de, T: Deserialize<'de>>(self) -> Result<T> { - self.try_into() + self.try_deserialize() } } |