aboutsummaryrefslogtreecommitdiff
path: root/src/never.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-11 21:28:50 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 06:41:55 +0200
commit620deab83d13d9aeca3bb894e6fc20c516c1405f (patch)
tree0d30976ac31942bc0c99413460193b3d7be95f58 /src/never.rs
parent83144505291319395c1ba40035cf933786bf3422 (diff)
break!: remove Never in favor of std::convert::Infallible
This change is a backport of 04e6cbe[1] from html5gum. [1]: https://github.com/untitaker/html5gum/commit/04e6cbe44bb7a388bd61d1c9cfe4c618eb3b0e29
Diffstat (limited to 'src/never.rs')
-rw-r--r--src/never.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/never.rs b/src/never.rs
deleted file mode 100644
index 85a1243..0000000
--- a/src/never.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-use std::error;
-use std::fmt;
-
-/// Definition of an empty enum.
-///
-/// This is used as the error type in situations where there can't be an error. A `Result<T, Never>`
-/// can be safely unwrapped and the `unwrap()` may be optimized away entirely.
-pub enum Never {}
-
-impl fmt::Display for Never {
- fn fmt(&self, _: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
- match *self {}
- }
-}
-impl fmt::Debug for Never {
- fn fmt(&self, _: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
- match *self {}
- }
-}
-
-impl error::Error for Never {}