add Proxy::custom to allow custom proxy functions

This commit is contained in:
Sean McArthur
2017-08-02 15:03:37 -07:00
parent df4b6bd8db
commit 229a2384a6
4 changed files with 155 additions and 44 deletions

View File

@@ -36,3 +36,7 @@ impl<'a> PolyfillTryInto for &'a String {
pub fn to_uri(url: &Url) -> ::hyper::Uri {
url.as_str().parse().expect("a parsed Url should always be a valid Uri")
}
pub fn to_url(uri: &::hyper::Uri) -> Url {
uri.as_ref().parse().expect("reqwest Uris should only ever come from Urls")
}