From c06982b7ac611b78e1f1c39b99d624c3d688f0f1 Mon Sep 17 00:00:00 2001 From: Szymon Walter Date: Mon, 19 Mar 2018 13:28:18 +0100 Subject: [PATCH] add `Infallible`, for errors which never occur --- src/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/error.rs b/src/error.rs index d6aee4f..353d8f2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -5,3 +5,11 @@ pub enum Error { OutOfBounds(usize), BadBlockGroupCount(u32, u32), } + +impl From for Error { + fn from(_: Infallible) -> Error { + unreachable!() + } +} + +pub enum Infallible {}