summaryrefslogtreecommitdiff
path: root/dhall/src/api/traits/dynamic_type.rs
diff options
context:
space:
mode:
authorNadrieril2019-05-09 21:54:45 +0200
committerNadrieril2019-05-09 21:54:45 +0200
commitdae106b3de0888e8a704c0efa3f9d991590f7858 (patch)
tree750daf7cb5b44bed4772ace3457c583c0ef86e4d /dhall/src/api/traits/dynamic_type.rs
parent6444faa2dee271e6d22226dc30b659e13fa8aead (diff)
Rewrite the StaticType trait and everything around it
Diffstat (limited to 'dhall/src/api/traits/dynamic_type.rs')
-rw-r--r--dhall/src/api/traits/dynamic_type.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/dhall/src/api/traits/dynamic_type.rs b/dhall/src/api/traits/dynamic_type.rs
deleted file mode 100644
index 7763a28..0000000
--- a/dhall/src/api/traits/dynamic_type.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use crate::error::TypeError;
-use crate::phase::{Normalized, Type, Typed};
-use crate::traits::StaticType;
-use std::borrow::Cow;
-
-pub trait DynamicType {
- 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> {
- Ok(Cow::Owned(T::get_static_type()))
- }
-}
-
-impl DynamicType for Type {
- fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> {
- self.get_type()
- }
-}
-
-impl DynamicType for Normalized {
- fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> {
- self.0.get_type()
- }
-}
-
-impl DynamicType for Typed {
- fn get_type(&self) -> Result<Cow<'_, Type>, TypeError> {
- self.get_type()
- }
-}