From e4ec9442d8fec9955c7d3d57708d84be7ba05f3e Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 12 Sep 2018 13:23:33 +0200 Subject: [PATCH] Make the Future returned by generated `future_from`s be Send --- src/api/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index 09ff964c..4ed3ddec 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -343,7 +343,7 @@ impl ToTokens for Api { } impl ::futures::future::FutureFrom<::http::Request<::hyper::Body>> for Request { - type Future = Box<_Future>; + type Future = Box<_Future + Send>; type Error = ::ruma_api::Error; #[allow(unused_variables)] @@ -405,12 +405,11 @@ impl ToTokens for Api { } impl ::futures::future::FutureFrom<::http::Response<::hyper::Body>> for Response { - type Future = Box<_Future>; + type Future = Box<_Future + Send>; type Error = ::ruma_api::Error; #[allow(unused_variables)] - fn future_from(http_response: ::http::Response<::hyper::Body>) - -> Box<_Future> { + fn future_from(http_response: ::http::Response<::hyper::Body>) -> Self::Future { if http_response.status().is_success() { #extract_response_headers