mirror of https://github.com/fafhrd91/actix-web
Merge branch 'add-infallible-for-ResponseError' of https://github.com/instrumentisto/actix-web into add-infallible-for-ResponseError
This commit is contained in:
commit
ad9ad9c6f2
|
@ -166,6 +166,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