diff options
author | Nadrieril | 2019-04-11 19:11:33 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-11 19:11:33 +0200 |
commit | 7ba857a96eebbdd1cef0aa22407c870887d24aed (patch) | |
tree | 6cf25ae288a0928dc3e94f27bb5290be560bac91 /dhall/src/traits/dynamic_type.rs | |
parent | a4ef23fd3e7a053def648dca05dfc9a043af9860 (diff) |
Remove type parameter from TypeError
Diffstat (limited to '')
-rw-r--r-- | dhall/src/traits/dynamic_type.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhall/src/traits/dynamic_type.rs b/dhall/src/traits/dynamic_type.rs index 66af320..d03f8cd 100644 --- a/dhall/src/traits/dynamic_type.rs +++ b/dhall/src/traits/dynamic_type.rs @@ -2,21 +2,21 @@ use crate::expr::*; use crate::traits::StaticType; use crate::typecheck::{TypeError, TypeMessage}; use dhall_core::context::Context; -use dhall_core::{Const, ExprF, X}; +use dhall_core::{Const, ExprF}; use std::borrow::Cow; pub trait DynamicType { - fn get_type<'a>(&'a self) -> Result<Cow<'a, Type>, TypeError<X>>; + fn get_type<'a>(&'a self) -> Result<Cow<'a, Type>, TypeError>; } impl<T: StaticType> DynamicType for T { - fn get_type<'a>(&'a self) -> Result<Cow<'a, Type>, TypeError<X>> { + fn get_type<'a>(&'a self) -> Result<Cow<'a, Type>, TypeError> { Ok(Cow::Owned(T::get_static_type())) } } impl DynamicType for Type { - fn get_type(&self) -> Result<Cow<'_, Type>, TypeError<X>> { + fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> { use TypeInternal::*; match &self.0 { Expr(e) => e.get_type(), @@ -30,7 +30,7 @@ impl DynamicType for Type { } impl DynamicType for Normalized { - fn get_type(&self) -> Result<Cow<'_, Type>, TypeError<X>> { + fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> { match &self.1 { Some(t) => Ok(Cow::Borrowed(t)), None => Err(TypeError::new( @@ -43,7 +43,7 @@ impl DynamicType for Normalized { } impl DynamicType for Typed { - fn get_type(&self) -> Result<Cow<'_, Type>, TypeError<X>> { + fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> { match &self.1 { Some(t) => Ok(Cow::Borrowed(t)), None => Err(TypeError::new( |