mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 14:49:20 +02:00
Add ability to use Infallible
as HttpResponse
error type (#1093)
* Add `std::convert::Infallible` implementantion for `ResponseError` * Add from `std::convert::Infallible` to `Error` * Remove `ResponseError` implementantion for `Infallible` * Remove useless docs * Better comment * Update changelog * Update actix_http::changelog
This commit is contained in:
@ -132,6 +132,14 @@ impl std::error::Error for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::convert::Infallible> for Error {
|
||||
fn from(_: std::convert::Infallible) -> Self {
|
||||
// `std::convert::Infallible` indicates an error
|
||||
// that will never happen
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert `Error` to a `Response` instance
|
||||
impl From<Error> for Response {
|
||||
fn from(err: Error) -> Self {
|
||||
|
Reference in New Issue
Block a user