Adding Send trait to HttpClient response

This commit is contained in:
Sajjad 2023-07-26 21:00:53 -04:00 committed by Dirkjan Ochtman
parent 72917d0350
commit 45e73b1cc5
1 changed files with 3 additions and 3 deletions

View File

@ -617,7 +617,7 @@ impl HttpClient for DefaultClient {
fn request( fn request(
&self, &self,
req: Request<Body>, req: Request<Body>,
) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>>>> { ) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>> + Send>> {
Box::pin(self.0.request(req)) Box::pin(self.0.request(req))
} }
} }
@ -644,7 +644,7 @@ pub trait HttpClient: Send + Sync + 'static {
fn request( fn request(
&self, &self,
req: Request<Body>, req: Request<Body>,
) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>>>>; ) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>> + Send>>;
} }
impl<C> HttpClient for hyper::Client<C> impl<C> HttpClient for hyper::Client<C>
@ -654,7 +654,7 @@ where
fn request( fn request(
&self, &self,
req: Request<Body>, req: Request<Body>,
) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>>>> { ) -> Pin<Box<dyn Future<Output = hyper::Result<Response<Body>>> + Send>> {
Box::pin(<hyper::Client<C>>::request(self, req)) Box::pin(<hyper::Client<C>>::request(self, req))
} }
} }