From ef134779d832b33b4b04471bf35637af01a32276 Mon Sep 17 00:00:00 2001 From: nWacky Date: Mon, 16 Sep 2019 16:46:16 +0300 Subject: [PATCH] Add from `std::convert::Infallible` to `Error` --- 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..c914f4321 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -132,6 +132,14 @@ impl std::error::Error for Error { } } +/// Convert `INTERNAL_SERVER_ERROR` to `std::convert::Infallible` +impl From for Error { + fn from(_: std::convert::Infallible) -> Self { + // `std::convert::Infallible` should never happen + unreachable!() + } +} + /// Convert `Error` to a `Response` instance impl From for Response { fn from(err: Error) -> Self {