async/client: return a impl Future on execute()

This commit is contained in:
Constantin Nickel
2019-02-20 15:58:44 +01:00
committed by Sean McArthur
parent cd0e4b3c2e
commit 4fba983e5e
2 changed files with 3 additions and 3 deletions

View File

@@ -464,12 +464,12 @@ impl Client {
/// ///
/// This method fails if there was an error while sending request, /// This method fails if there was an error while sending request,
/// redirect loop was detected or redirect limit was exhausted. /// redirect loop was detected or redirect limit was exhausted.
pub fn execute(&self, request: Request) -> Pending { pub fn execute(&self, request: Request) -> impl Future<Item = Response, Error = ::Error> {
self.execute_request(request) self.execute_request(request)
} }
fn execute_request(&self, req: Request) -> Pending { pub(super) fn execute_request(&self, req: Request) -> Pending {
let ( let (
method, method,
url, url,

View File

@@ -346,7 +346,7 @@ impl RequestBuilder {
/// ``` /// ```
pub fn send(self) -> impl Future<Item = Response, Error = ::Error> { pub fn send(self) -> impl Future<Item = Response, Error = ::Error> {
match self.request { match self.request {
Ok(req) => self.client.execute(req), Ok(req) => self.client.execute_request(req),
Err(err) => Pending::new_err(err), Err(err) => Pending::new_err(err),
} }
} }