From e509f80cdfa7527aaae275b6cea91d2bed9d4610 Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Fri, 7 Jul 2017 23:49:34 -0700 Subject: [PATCH] Use a reference to convert Url into Uri. See: https://github.com/hyperium/hyper/issues/1089#issuecomment-288842526 --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9afdaf52..886321dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,9 +21,10 @@ extern crate url; use std::convert::TryInto; use std::rc::Rc; +use std::str::FromStr; use futures::future::{Future, FutureFrom, IntoFuture}; -use hyper::Client as HyperClient; +use hyper::{Client as HyperClient, Uri}; use hyper::client::{Connect, HttpConnector}; #[cfg(feature = "hyper-tls")] use hyper_tls::HttpsConnector; @@ -120,8 +121,7 @@ where url.set_query(uri.query()); } - url.into_string() - .parse() + Uri::from_str(url.as_ref()) .map(move |uri| (uri, hyper_request)) .map_err(Error::from) })