diff options
author | Ryan Leckey <leckey.ryan@gmail.com> | 2018-07-02 15:04:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 15:04:52 -0700 |
commit | e5a8323544ec98254d459ec6ecac43c162529390 (patch) | |
tree | ffe6f758823f5e9eabf0f0a60a3a5294c1520888 /src | |
parent | e8fa9fee96185ddd18ebcef8a925c75459111edb (diff) | |
parent | 375befa7ddbdb1761611947226a0c117f4c35a5e (diff) |
Merge pull request #71 from ivanovaleksey/issue-70
Deserialize newtype struct
Diffstat (limited to 'src')
-rw-r--r-- | src/de.rs | 9 | ||||
-rw-r--r-- | src/value.rs | 6 |
2 files changed, 11 insertions, 4 deletions
@@ -224,9 +224,16 @@ impl<'de> de::Deserializer<'de> for Value { } } + fn deserialize_newtype_struct<V>(self, _name: &'static str, visitor: V) -> Result<V::Value> + where + V: de::Visitor<'de> + { + visitor.visit_newtype_struct(self) + } + forward_to_deserialize_any! { char seq - bytes byte_buf map struct unit enum newtype_struct + bytes byte_buf map struct unit enum identifier ignored_any unit_struct tuple_struct tuple } } diff --git a/src/value.rs b/src/value.rs index a8ae94a..4a3186b 100644 --- a/src/value.rs +++ b/src/value.rs @@ -119,17 +119,17 @@ pub struct Value { /// A description of the original location of the value. /// /// A Value originating from a File might contain: - /// ``` + /// ```text /// Settings.toml /// ``` /// /// A Value originating from the environment would contain: - /// ``` + /// ```text /// the envrionment /// ``` /// /// A Value originating from a remote source might contain: - /// ``` + /// ```text /// etcd+http://127.0.0.1:2379 /// ``` origin: Option<String>, |