mirror of https://github.com/fafhrd91/actix-web
Add from `std::convert::Infallible` to `Error`
This commit is contained in:
parent
c1f99e0775
commit
ef134779d8
|
@ -132,6 +132,14 @@ impl std::error::Error for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Convert `INTERNAL_SERVER_ERROR` to `std::convert::Infallible`
|
||||||
|
impl From<std::convert::Infallible> for Error {
|
||||||
|
fn from(_: std::convert::Infallible) -> Self {
|
||||||
|
// `std::convert::Infallible` should never happen
|
||||||
|
unreachable!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Convert `Error` to a `Response` instance
|
/// Convert `Error` to a `Response` instance
|
||||||
impl From<Error> for Response {
|
impl From<Error> for Response {
|
||||||
fn from(err: Error) -> Self {
|
fn from(err: Error) -> Self {
|
||||||
|
|
Loading…
Reference in New Issue