diff options
author | Nadrieril | 2019-04-10 21:46:25 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-10 21:56:31 +0200 |
commit | c7184b841279a55bdfb39bde429896d221aa666c (patch) | |
tree | d4aaeed957b77b6f906411baf9bcdc1a3dbc87bb /dhall/src/traits | |
parent | 56edb3a50fb4168ed76a3795f0ed774a754b6c32 (diff) |
Cleanup error handling
Closes #41
Diffstat (limited to '')
-rw-r--r-- | dhall/src/traits/deserialize.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dhall/src/traits/deserialize.rs b/dhall/src/traits/deserialize.rs index 8d1f565..ad4cde6 100644 --- a/dhall/src/traits/deserialize.rs +++ b/dhall/src/traits/deserialize.rs @@ -9,7 +9,7 @@ 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> { - Ok(Parsed::parse_str(s).map_err(|_| ())?) + Ok(Parsed::parse_str(s)?) } } @@ -17,7 +17,7 @@ impl<'a> Deserialize<'a> for Resolved { /// Parses and resolves the provided string. Ignores the /// provided type. fn from_str(s: &'a str, ty: Option<&Type>) -> Result<Self> { - Ok(Parsed::from_str(s, ty)?.resolve().map_err(|_| ())?) + Ok(Parsed::from_str(s, ty)?.resolve()?) } } @@ -25,7 +25,7 @@ impl<'a> Deserialize<'a> for Typed { /// Parses, resolves and typechecks the provided string. fn from_str(s: &'a str, ty: Option<&Type>) -> Result<Self> { // TODO: compare with provided type - Ok(Resolved::from_str(s, ty)?.typecheck().map_err(|_| ())?) + Ok(Resolved::from_str(s, ty)?.typecheck()?) } } |