mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 23:51:06 +01: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:
parent
c1f99e0775
commit
7c9f9afc46
@ -6,6 +6,9 @@
|
||||
|
||||
* Add support for sending HTTP requests with `Rc<RequestHead>` in addition to sending HTTP requests with `RequestHead`
|
||||
|
||||
* Allow to use `std::convert::Infallible` as `actix_http::error::Error`
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
* h2 will use error response #1080
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user