From 7ba857a96eebbdd1cef0aa22407c870887d24aed Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 11 Apr 2019 19:11:33 +0200 Subject: Remove type parameter from TypeError --- dhall/src/traits/dynamic_type.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dhall/src/traits/dynamic_type.rs') 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, TypeError>; + fn get_type<'a>(&'a self) -> Result, TypeError>; } impl DynamicType for T { - fn get_type<'a>(&'a self) -> Result, TypeError> { + fn get_type<'a>(&'a self) -> Result, TypeError> { Ok(Cow::Owned(T::get_static_type())) } } impl DynamicType for Type { - fn get_type(&self) -> Result, TypeError> { + fn get_type(&self) -> Result, 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, TypeError> { + fn get_type(&self) -> Result, 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, TypeError> { + fn get_type(&self) -> Result, TypeError> { match &self.1 { Some(t) => Ok(Cow::Borrowed(t)), None => Err(TypeError::new( -- cgit v1.2.3