From e1d6834a10decf385bbb1c3461683da8612bfa49 Mon Sep 17 00:00:00 2001 From: Michael Hewson Date: Wed, 19 Feb 2020 12:54:10 -0500 Subject: [PATCH] Generalize Reply impl for Box (#450) We had a case where we were boxing up replies, and needed them to impl `Send + Sync` to use in other code. `Box` unfortunately doesn't implement `Reply`, because the impl is too specific. This generalizes the impl of `Reply` to include any `Box` where `T: Reply + ?Sized`. --- src/reply.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reply.rs b/src/reply.rs index f4023d7cb..657e6e822 100644 --- a/src/reply.rs +++ b/src/reply.rs @@ -289,7 +289,7 @@ pub trait Reply: BoxedReply + Send { */ } -impl Reply for Box { +impl Reply for Box { fn into_response(self) -> Response { self.boxed_into_response(Internal) } @@ -541,7 +541,7 @@ mod sealed { impl BoxedReply for T { fn boxed_into_response(self: Box, _: Internal) -> Response { - self.into_response() + (*self).into_response() } } }