summaryrefslogtreecommitdiff
path: root/dhall/src/traits
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/traits')
-rw-r--r--dhall/src/traits/deserialize.rs2
-rw-r--r--dhall/src/traits/static_type.rs24
2 files changed, 25 insertions, 1 deletions
diff --git a/dhall/src/traits/deserialize.rs b/dhall/src/traits/deserialize.rs
index 5271a65..1fbdfe1 100644
--- a/dhall/src/traits/deserialize.rs
+++ b/dhall/src/traits/deserialize.rs
@@ -8,7 +8,7 @@ pub trait Deserialize<'a>: Sized {
impl<'a> Deserialize<'a> for Parsed {
/// Simply parses the provided string. Ignores the
/// provided type.
- fn from_str(s: &'a str, _ty: Option<&Type>) -> Result<Self> {
+ fn from_str(s: &'a str, _: Option<&Type>) -> Result<Self> {
Ok(Parsed::parse_str(s)?)
}
}
diff --git a/dhall/src/traits/static_type.rs b/dhall/src/traits/static_type.rs
index b402ca9..6c41e3f 100644
--- a/dhall/src/traits/static_type.rs
+++ b/dhall/src/traits/static_type.rs
@@ -47,12 +47,36 @@ impl SimpleStaticType for Natural {
}
}
+impl SimpleStaticType for u32 {
+ fn get_simple_static_type() -> SimpleType {
+ mktype(dhall_expr!(Natural))
+ }
+}
+
+impl SimpleStaticType for u64 {
+ fn get_simple_static_type() -> SimpleType {
+ mktype(dhall_expr!(Natural))
+ }
+}
+
impl SimpleStaticType for Integer {
fn get_simple_static_type() -> SimpleType {
mktype(dhall_expr!(Integer))
}
}
+impl SimpleStaticType for i32 {
+ fn get_simple_static_type() -> SimpleType {
+ mktype(dhall_expr!(Integer))
+ }
+}
+
+impl SimpleStaticType for i64 {
+ fn get_simple_static_type() -> SimpleType {
+ mktype(dhall_expr!(Integer))
+ }
+}
+
impl SimpleStaticType for String {
fn get_simple_static_type() -> SimpleType {
mktype(dhall_expr!(Text))