mirror of https://github.com/fafhrd91/actix-web
Add `std::convert::Infallible` implementantion for `ResponseError`
This commit is contained in:
parent
c1f99e0775
commit
20e8c9ebfa
|
@ -158,6 +158,14 @@ impl<E: ResponseError> ResponseError for TimeoutError<E> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return `INTERNAL_SERVER_ERROR` for `std::convert::Infallible`
|
||||||
|
impl ResponseError for std::convert::Infallible {
|
||||||
|
fn error_response(&self) -> Response {
|
||||||
|
// `std::convert::Infallible` should never happen
|
||||||
|
unreachable!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Display)]
|
#[derive(Debug, Display)]
|
||||||
#[display(fmt = "UnknownError")]
|
#[display(fmt = "UnknownError")]
|
||||||
struct UnitError;
|
struct UnitError;
|
||||||
|
|
Loading…
Reference in New Issue