Use a reference to convert Url into Uri.
See: https://github.com/hyperium/hyper/issues/1089#issuecomment-288842526
This commit is contained in:
parent
da5ce8ee11
commit
e509f80cdf
@ -21,9 +21,10 @@ extern crate url;
|
|||||||
|
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
use futures::future::{Future, FutureFrom, IntoFuture};
|
use futures::future::{Future, FutureFrom, IntoFuture};
|
||||||
use hyper::Client as HyperClient;
|
use hyper::{Client as HyperClient, Uri};
|
||||||
use hyper::client::{Connect, HttpConnector};
|
use hyper::client::{Connect, HttpConnector};
|
||||||
#[cfg(feature = "hyper-tls")]
|
#[cfg(feature = "hyper-tls")]
|
||||||
use hyper_tls::HttpsConnector;
|
use hyper_tls::HttpsConnector;
|
||||||
@ -120,8 +121,7 @@ where
|
|||||||
url.set_query(uri.query());
|
url.set_query(uri.query());
|
||||||
}
|
}
|
||||||
|
|
||||||
url.into_string()
|
Uri::from_str(url.as_ref())
|
||||||
.parse()
|
|
||||||
.map(move |uri| (uri, hyper_request))
|
.map(move |uri| (uri, hyper_request))
|
||||||
.map_err(Error::from)
|
.map_err(Error::from)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user