Implement From<!> for Error

This commit is contained in:
Ivan Smirnov 2021-12-31 13:33:45 +03:00
parent 6019791c3b
commit c39844fb98

View file

@ -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<Infallible> for Error {
fn from(_: Infallible) -> Self {
unreachable!()
}
}