diff options
author | Nadrieril Feneanar | 2020-03-18 00:01:11 +0000 |
---|---|---|
committer | GitHub | 2020-03-18 00:01:11 +0000 |
commit | f42ab8acdaa4dee753b7daccfed1ca3c8738095a (patch) | |
tree | 9fba7dd6d865884c0651af2dd7e01b243a0f25f0 /dhall/src/syntax/ast/expr.rs | |
parent | 71fddc59b5b427f52dd2f0cd76f788eb995a4e2e (diff) | |
parent | 40441abd2d6c2938244fa1bb2ca26ee9b8e4ab27 (diff) |
Merge pull request #146 from Nadrieril/never_never
Use stable toolchain 🎉
Diffstat (limited to '')
-rw-r--r-- | dhall/src/syntax/ast/expr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs index ce0a3d2..8023771 100644 --- a/dhall/src/syntax/ast/expr.rs +++ b/dhall/src/syntax/ast/expr.rs @@ -257,10 +257,12 @@ impl Expr { } } -pub fn trivial_result<T>(x: Result<T, !>) -> T { +// Empty enum to indicate that no error can occur +enum X {} +fn trivial_result<T>(x: Result<T, X>) -> T { match x { Ok(x) => x, - Err(e) => e, + Err(e) => match e {}, } } |