summaryrefslogtreecommitdiff
path: root/serde_dhall
diff options
context:
space:
mode:
authorNadrieril2020-03-13 16:50:49 +0000
committerNadrieril2020-03-31 21:44:01 +0100
commit2f5c45fd2f712f7befe6f7c92b62dc76d5f77538 (patch)
tree4331c48d2519ba3ebb8de9c481f6fda684b70a47 /serde_dhall
parentf175ea7860cc1dd614b17912140ab7f5400c6bff (diff)
Rename LitKind to NumKind
Diffstat (limited to '')
-rw-r--r--serde_dhall/src/serde.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/serde_dhall/src/serde.rs b/serde_dhall/src/serde.rs
index 5d8fcf3..227ba31 100644
--- a/serde_dhall/src/serde.rs
+++ b/serde_dhall/src/serde.rs
@@ -4,7 +4,7 @@ use serde::de::value::{
MapAccessDeserializer, MapDeserializer, SeqDeserializer,
};
-use dhall::syntax::LitKind;
+use dhall::syntax::NumKind;
use dhall::{SValKind, SimpleValue};
use crate::de::{Deserialize, Error, Result};
@@ -44,13 +44,13 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> {
V: serde::de::Visitor<'de>,
{
use std::convert::TryInto;
- use LitKind::*;
+ use NumKind::*;
use SValKind::*;
let val = |x| Deserializer(Cow::Borrowed(x));
match self.0.kind() {
- Lit(Bool(x)) => visitor.visit_bool(*x),
- Lit(Natural(x)) => {
+ Num(Bool(x)) => visitor.visit_bool(*x),
+ Num(Natural(x)) => {
if let Ok(x64) = (*x).try_into() {
visitor.visit_u64(x64)
} else if let Ok(x32) = (*x).try_into() {
@@ -59,7 +59,7 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> {
unimplemented!()
}
}
- Lit(Integer(x)) => {
+ Num(Integer(x)) => {
if let Ok(x64) = (*x).try_into() {
visitor.visit_i64(x64)
} else if let Ok(x32) = (*x).try_into() {
@@ -68,7 +68,7 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> {
unimplemented!()
}
}
- Lit(Double(x)) => visitor.visit_f64((*x).into()),
+ Num(Double(x)) => visitor.visit_f64((*x).into()),
Text(x) => visitor.visit_str(x),
List(xs) => {
visitor.visit_seq(SeqDeserializer::new(xs.iter().map(val)))