From 26ed5a1d4d43573ac8ad2f8de9e4dd411650aa9a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 19 Feb 2020 17:24:41 +0000 Subject: Expose fewer pub things --- serde_dhall/src/serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'serde_dhall') diff --git a/serde_dhall/src/serde.rs b/serde_dhall/src/serde.rs index 160392d..4fd7815 100644 --- a/serde_dhall/src/serde.rs +++ b/serde_dhall/src/serde.rs @@ -48,7 +48,7 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> { ))) }; - match expr.as_ref() { + match expr.kind() { Lit(Bool(x)) => visitor.visit_bool(*x), Lit(Natural(x)) => { if let Ok(x64) = (*x).try_into() { @@ -81,11 +81,11 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> { xs.iter().map(|x| Deserializer(Cow::Borrowed(x))), )), SomeLit(x) => visitor.visit_some(Deserializer(Cow::Borrowed(x))), - App(f, x) => match f.as_ref() { + App(f, x) => match f.kind() { Builtin(dhall::syntax::Builtin::OptionalNone) => { visitor.visit_none() } - Field(y, name) => match y.as_ref() { + Field(y, name) => match y.kind() { UnionType(..) => { let name: String = name.into(); visitor.visit_enum(MapAccessDeserializer::new( @@ -103,7 +103,7 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> { .visit_map(MapDeserializer::new(m.iter().map(|(k, v)| { (k.as_ref(), Deserializer(Cow::Borrowed(v))) }))), - Field(y, name) => match y.as_ref() { + Field(y, name) => match y.kind() { UnionType(..) => { let name: String = name.into(); visitor.visit_enum(MapAccessDeserializer::new( @@ -127,7 +127,7 @@ impl<'de: 'a, 'a> serde::Deserializer<'de> for Deserializer<'a> { use ExprKind::*; let expr = self.0.as_ref(); - match expr.as_ref() { + match expr.kind() { // Blindly takes keys in sorted order. RecordLit(m) => visitor.visit_seq(SeqDeserializer::new( m.iter().map(|(_, v)| Deserializer(Cow::Borrowed(v))), -- cgit v1.2.3