From 20e8c9ebfa1d7e8cdc36a3516b1bb077d26d5e5b Mon Sep 17 00:00:00 2001 From: nWacky Date: Mon, 16 Sep 2019 15:58:22 +0300 Subject: [PATCH] Add `std::convert::Infallible` implementantion for `ResponseError` --- actix-http/src/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 2c01c86db..9e520c722 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -158,6 +158,14 @@ impl ResponseError for TimeoutError { } } +/// 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)] #[display(fmt = "UnknownError")] struct UnitError;