From f1a51da873d33ac6e64f66794132c7725dd2d222 Mon Sep 17 00:00:00 2001 From: dswij Date: Tue, 31 Jan 2023 03:02:29 +0800 Subject: [PATCH] tests(client): update test to use new `conn::http2::builder::new` --- tests/client.rs | 21 +++++++-------------- tests/server.rs | 6 ++---- tests/support/mod.rs | 13 ++++++------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/tests/client.rs b/tests/client.rs index aa88917215..739f223b16 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -1922,8 +1922,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .handshake(io) .await .expect("http handshake"); @@ -1979,8 +1978,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (_client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (_client, conn) = conn::http2::Builder::new(TokioExecutor) .timer(TokioTimer) .keep_alive_interval(Duration::from_secs(1)) .keep_alive_timeout(Duration::from_secs(1)) @@ -2008,8 +2006,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .timer(TokioTimer) .keep_alive_interval(Duration::from_secs(1)) .keep_alive_timeout(Duration::from_secs(1)) @@ -2040,8 +2037,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .timer(TokioTimer) .keep_alive_interval(Duration::from_secs(1)) .keep_alive_timeout(Duration::from_secs(1)) @@ -2100,8 +2096,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .timer(TokioTimer) .keep_alive_interval(Duration::from_secs(1)) .keep_alive_timeout(Duration::from_secs(1)) @@ -2156,8 +2151,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .handshake(io) .await .expect("http handshake"); @@ -2207,8 +2201,7 @@ mod conn { }); let io = tcp_connect(&addr).await.expect("tcp connect"); - let (mut client, conn) = conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = conn::http2::Builder::new(TokioExecutor) .handshake::<_, Empty>(io) .await .expect("http handshake"); diff --git a/tests/server.rs b/tests/server.rs index 5fe08848f7..68c53ce5c0 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -2389,8 +2389,7 @@ async fn http2_keep_alive_with_responsive_client() { }); let tcp = connect_async(addr).await; - let (mut client, conn) = hyper::client::conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut client, conn) = hyper::client::conn::http2::Builder::new(TokioExecutor) .handshake(tcp) .await .expect("http handshake"); @@ -3017,8 +3016,7 @@ impl TestClient { .unwrap(); if self.http2_only { - let (mut sender, conn) = hyper::client::conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut sender, conn) = hyper::client::conn::http2::Builder::new(TokioExecutor) .handshake(stream) .await .unwrap(); diff --git a/tests/support/mod.rs b/tests/support/mod.rs index a8eb37dc35..e7e1e8c6bd 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -427,8 +427,7 @@ async fn async_test(cfg: __TestConfig) { let stream = TcpStream::connect(addr).await.unwrap(); let res = if http2_only { - let (mut sender, conn) = hyper::client::conn::http2::Builder::new() - .executor(TokioExecutor) + let (mut sender, conn) = hyper::client::conn::http2::Builder::new(TokioExecutor) .handshake(stream) .await .unwrap(); @@ -526,11 +525,11 @@ async fn naive_proxy(cfg: ProxyConfig) -> (SocketAddr, impl Future) .unwrap(); let resp = if http2_only { - let (mut sender, conn) = hyper::client::conn::http2::Builder::new() - .executor(TokioExecutor) - .handshake(stream) - .await - .unwrap(); + let (mut sender, conn) = + hyper::client::conn::http2::Builder::new(TokioExecutor) + .handshake(stream) + .await + .unwrap(); tokio::task::spawn(async move { if let Err(err) = conn.await {