summaryrefslogtreecommitdiff
path: root/dhall/src/traits
diff options
context:
space:
mode:
authorNadrieril2019-04-23 14:13:50 +0200
committerNadrieril2019-04-23 14:14:09 +0200
commit2f1fa26abd9c9f2b75d24b18877d3b278f7d2a01 (patch)
tree602fdc4982433680e82a0bfeb872140f09e828d0 /dhall/src/traits
parent162d2a2a6d241d525346e295b0cf2ad43387bed5 (diff)
Avoid duplicating work when matching on Pi types
Diffstat (limited to 'dhall/src/traits')
-rw-r--r--dhall/src/traits/deserialize.rs2
-rw-r--r--dhall/src/traits/static_type.rs1
2 files changed, 2 insertions, 1 deletions
diff --git a/dhall/src/traits/deserialize.rs b/dhall/src/traits/deserialize.rs
index 43eb2ac..9cc2147 100644
--- a/dhall/src/traits/deserialize.rs
+++ b/dhall/src/traits/deserialize.rs
@@ -48,6 +48,6 @@ impl<'de: 'a, 'a> Deserialize<'de> for Normalized<'a> {
impl<'de: 'a, 'a> Deserialize<'de> for Type<'a> {
fn from_str(s: &'de str, ty: Option<&Type>) -> Result<Self> {
- Ok(Normalized::from_str(s, ty)?.into_type())
+ Ok(Normalized::from_str(s, ty)?.into_type()?)
}
}
diff --git a/dhall/src/traits/static_type.rs b/dhall/src/traits/static_type.rs
index e92ce78..225eb32 100644
--- a/dhall/src/traits/static_type.rs
+++ b/dhall/src/traits/static_type.rs
@@ -44,6 +44,7 @@ impl<T: SimpleStaticType> StaticType for T {
std::marker::PhantomData,
)
.into_type()
+ .unwrap()
}
}