From bc64e9e305f50ad04e6e2071dad8c153c1582b8c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 31 Mar 2019 13:24:27 +0200 Subject: Remove some redundant namespacing --- dhall/src/dhall_type.rs | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'dhall/src/dhall_type.rs') diff --git a/dhall/src/dhall_type.rs b/dhall/src/dhall_type.rs index 8abef32..6b0e06e 100644 --- a/dhall/src/dhall_type.rs +++ b/dhall/src/dhall_type.rs @@ -2,76 +2,76 @@ use dhall_core::*; use dhall_generator::*; #[derive(Debug, Clone)] -pub enum DhallConversionError {} +pub enum ConversionError {} -pub trait DhallType: Sized { - fn dhall_type() -> DhallExpr; +pub trait Type { + fn get_type() -> DhallExpr; // fn as_dhall(&self) -> DhallExpr; // fn from_dhall(e: DhallExpr) -> Result; } -impl DhallType for bool { - fn dhall_type() -> DhallExpr { +impl Type for bool { + fn get_type() -> DhallExpr { dhall_expr!(Bool) } } -impl DhallType for Natural { - fn dhall_type() -> DhallExpr { +impl Type for Natural { + fn get_type() -> DhallExpr { dhall_expr!(Natural) } } -impl DhallType for Integer { - fn dhall_type() -> DhallExpr { +impl Type for Integer { + fn get_type() -> DhallExpr { dhall_expr!(Integer) } } -impl DhallType for String { - fn dhall_type() -> DhallExpr { +impl Type for String { + fn get_type() -> DhallExpr { dhall_expr!(Text) } } -impl DhallType for (A, B) { - fn dhall_type() -> DhallExpr { - let ta = A::dhall_type(); - let tb = B::dhall_type(); +impl Type for (A, B) { + fn get_type() -> DhallExpr { + let ta = A::get_type(); + let tb = B::get_type(); dhall_expr!({ _1: ta, _2: tb }) } } -impl DhallType for Option { - fn dhall_type() -> DhallExpr { - let t = T::dhall_type(); +impl Type for Option { + fn get_type() -> DhallExpr { + let t = T::get_type(); dhall_expr!(Optional t) } } -impl DhallType for Vec { - fn dhall_type() -> DhallExpr { - let t = T::dhall_type(); +impl Type for Vec { + fn get_type() -> DhallExpr { + let t = T::get_type(); dhall_expr!(List t) } } -impl<'a, T: DhallType> DhallType for &'a T { - fn dhall_type() -> DhallExpr { - T::dhall_type() +impl<'a, T: Type> Type for &'a T { + fn get_type() -> DhallExpr { + T::get_type() } } -impl DhallType for std::marker::PhantomData { - fn dhall_type() -> DhallExpr { +impl Type for std::marker::PhantomData { + fn get_type() -> DhallExpr { dhall_expr!({}) } } -impl DhallType for Result { - fn dhall_type() -> DhallExpr { - let tt = T::dhall_type(); - let te = E::dhall_type(); +impl Type for Result { + fn get_type() -> DhallExpr { + let tt = T::get_type(); + let te = E::get_type(); dhall_expr!(< Ok: tt | Err: te>) } } -- cgit v1.2.3