From c39844fb983c72354685c8646b708723a9ff0643 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Fri, 31 Dec 2021 13:33:45 +0300 Subject: [PATCH] Implement From for Error --- src/error.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/error.rs b/src/error.rs index 049c02d..2352682 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,3 +1,4 @@ +use std::convert::Infallible; use std::error::Error as StdError; use std::fmt::{self, Display}; use std::result::Result as StdResult; @@ -52,3 +53,9 @@ impl Display for Error { } impl StdError for Error {} + +impl From for Error { + fn from(_: Infallible) -> Self { + unreachable!() + } +}