aboutsummaryrefslogtreecommitdiff
path: root/src/de.rs
diff options
context:
space:
mode:
authorVincent Prouillet <vincent@wearewizards.io>2017-04-25 13:57:35 +0900
committerVincent Prouillet <vincent@wearewizards.io>2017-04-25 13:57:35 +0900
commit45acd4f5b592536f013b94084faca41b42e48c13 (patch)
treef3215a7c4d2049cdf0d639763743502ab5f6bd6b /src/de.rs
parent9b7fbd316a680fb0f1cad46af7c65eba80526318 (diff)
downloadmilf-rs-45acd4f5b592536f013b94084faca41b42e48c13.tar.gz
milf-rs-45acd4f5b592536f013b94084faca41b42e48c13.zip
Deserialize enum in Value
Diffstat (limited to 'src/de.rs')
-rw-r--r--src/de.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/de.rs b/src/de.rs
index b29fc98..abb7cda 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -209,7 +209,7 @@ impl<'de, 'b> de::Deserializer<'de> for &'b mut Deserializer<'de> {
if self.peek_char()? == '"' {
// Visit a unit variant.
match self.next()?.unwrap() {
- Token::String { ref val, ..} => {
+ Token::String { ref val, .. } => {
visitor.visit_enum(val.clone().into_deserializer())
},
_ => Err(Error::from_kind(ErrorKind::ExpectedString))
@@ -602,6 +602,7 @@ impl<'de> de::MapAccess<'de> for InlineTableDeserializer<'de> {
}
}
+
impl<'a> Deserializer<'a> {
/// Creates a new deserializer which will be deserializing the string
/// provided.
@@ -1229,6 +1230,7 @@ impl<'a> Header<'a> {
}
}
+#[derive(Debug)]
enum Value<'a> {
Integer(i64),
Float(f64),