diff --git a/src/lib.rs b/src/lib.rs index 2fe51f5..efdf7e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,7 +248,9 @@ where } fn call(&mut self, req: http::Request) -> Self::Future { - AsyncResponseFuture::new(req, &mut self.f, self.inner.clone()) + let clone = self.inner.clone(); + let inner = std::mem::replace(&mut self.inner, clone); + AsyncResponseFuture::new(req, &mut self.f, inner) } }