diff options
author | Nadrieril | 2019-08-16 11:11:28 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-16 11:11:28 +0200 |
commit | 509743469035582d916e6a2f331fd5018c81447e (patch) | |
tree | 7689c8ff696e8c6c28bd864ec6b46a2ef941f8de /dhall_syntax/src/core/expr.rs | |
parent | 91ba644fa47c29feb57dba957ee8aa115ed95fef (diff) |
Use `!` type instead of custom empty type
Diffstat (limited to '')
-rw-r--r-- | dhall_syntax/src/core/expr.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs index 30ac4eb..efbcee2 100644 --- a/dhall_syntax/src/core/expr.rs +++ b/dhall_syntax/src/core/expr.rs @@ -8,20 +8,10 @@ pub type Integer = isize; pub type Natural = usize; pub type Double = NaiveDouble; -/// An empty type -#[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub enum Void {} - -impl std::fmt::Display for Void { - fn fmt(&self, _f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { - match *self {} - } -} - -pub fn trivial_result<T>(x: Result<T, Void>) -> T { +pub fn trivial_result<T>(x: Result<T, !>) -> T { match x { Ok(x) => x, - Err(e) => match e {}, + Err(e) => e, } } |