feat(client): remove Destination for http::Uri in connectors

BREAKING CHANGE: All usage of `hyper::client::connect::Destination`
  should be replaced with `http::Uri`.
This commit is contained in:
Sean McArthur
2019-12-04 12:49:44 -08:00
parent 9645a125e6
commit 319e8aee15
6 changed files with 40 additions and 430 deletions

View File

@@ -5,7 +5,7 @@ extern crate test;
use std::net::SocketAddr;
use tokio::net::TcpListener;
use hyper::client::connect::{Destination, HttpConnector};
use hyper::client::connect::{HttpConnector};
use hyper::service::Service;
use http::Uri;
@@ -19,8 +19,7 @@ fn http_connector(b: &mut test::Bencher) {
.expect("rt build");
let mut listener = rt.block_on(TcpListener::bind(&SocketAddr::from(([127, 0, 0, 1], 0)))).expect("bind");
let addr = listener.local_addr().expect("local_addr");
let uri: Uri = format!("http://{}/", addr).parse().expect("uri parse");
let dst = Destination::try_from_uri(uri).expect("destination");
let dst: Uri = format!("http://{}/", addr).parse().expect("uri parse");
let mut connector = HttpConnector::new();
rt.spawn(async move {