async/client: return a impl Future on execute()
This commit is contained in:
committed by
Sean McArthur
parent
cd0e4b3c2e
commit
4fba983e5e
@@ -464,12 +464,12 @@ impl Client {
|
||||
///
|
||||
/// This method fails if there was an error while sending request,
|
||||
/// 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)
|
||||
}
|
||||
|
||||
|
||||
fn execute_request(&self, req: Request) -> Pending {
|
||||
pub(super) fn execute_request(&self, req: Request) -> Pending {
|
||||
let (
|
||||
method,
|
||||
url,
|
||||
|
||||
@@ -346,7 +346,7 @@ impl RequestBuilder {
|
||||
/// ```
|
||||
pub fn send(self) -> impl Future<Item = Response, Error = ::Error> {
|
||||
match self.request {
|
||||
Ok(req) => self.client.execute(req),
|
||||
Ok(req) => self.client.execute_request(req),
|
||||
Err(err) => Pending::new_err(err),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user