From 697e93e0f56e3c063ce253983f703be88d468b47 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 7 Dec 2020 11:56:00 +0000 Subject: Don't store internal structures of `dhall` in `serde_dhall` --- serde_dhall/src/options/de.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'serde_dhall/src/options/de.rs') diff --git a/serde_dhall/src/options/de.rs b/serde_dhall/src/options/de.rs index 22fa7ba..39ab5ca 100644 --- a/serde_dhall/src/options/de.rs +++ b/serde_dhall/src/options/de.rs @@ -229,7 +229,7 @@ impl<'a, A> Deserializer<'a, A> { // self // } - fn _parse(&self) -> dhall::error::Result + fn _parse(&self) -> dhall::error::Result> where A: TypeAnnot, T: HasAnnot, @@ -246,9 +246,12 @@ impl<'a, A> Deserializer<'a, A> { }; let typed = match &T::get_annot(self.annot) { None => resolved.typecheck()?, - Some(ty) => resolved.typecheck_with(ty.to_value().as_hir())?, + Some(ty) => resolved.typecheck_with(&ty.to_hir())?, }; - Ok(Value::from_nir(typed.normalize().as_nir())) + Ok(Value::from_nir_and_ty( + typed.normalize().as_nir(), + typed.ty().as_nir(), + )) } /// Parses the chosen dhall value with the options provided. @@ -274,7 +277,7 @@ impl<'a, A> Deserializer<'a, A> { let val = self ._parse::() .map_err(ErrorKind::Dhall) - .map_err(Error)?; + .map_err(Error)??; T::from_dhall(&val) } } -- cgit v1.2.3