From 74aefbe500df5bb2d9a87844580b4ac21d49f134 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 21 Mar 2017 14:51:13 -0700 Subject: [PATCH] update from Url to Uri --- src/client.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client.rs b/src/client.rs index ff1f761..360b0f8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -3,7 +3,7 @@ use std::io; use futures::{Future, Poll}; use hyper::client::HttpConnector; -use hyper::Url; +use hyper::Uri; use native_tls::TlsConnector; use tokio_core::reactor::Handle; use tokio_service::Service; @@ -37,14 +37,14 @@ impl fmt::Debug for HttpsConnector { } impl Service for HttpsConnector { - type Request = Url; + type Request = Uri; type Response = MaybeHttpsStream; type Error = io::Error; type Future = HttpsConnecting; - fn call(&self, url: Url) -> Self::Future { - let is_https = url.scheme() == "https"; - let host = match url.host_str() { + fn call(&self, uri: Uri) -> Self::Future { + let is_https = uri.scheme() == Some("https"); + let host = match uri.host() { Some(host) => host.to_owned(), None => return HttpsConnecting( Box::new( @@ -57,7 +57,7 @@ impl Service for HttpsConnector { ) ), }; - let connecting = self.http.call(url); + let connecting = self.http.call(uri); HttpsConnecting(if is_https { Box::new(connecting.and_then(move |tcp| {