From fa113433d91e5c34846a3d851d224a280c9d75df Mon Sep 17 00:00:00 2001 From: Gabriel Goller Date: Thu, 16 Nov 2023 10:02:45 +0100 Subject: [PATCH] feat: moved connect module to legacy Moved the `connect` module to the legacy namespace to make space for new changes. Renamed legacy.rs -> client.rs and also moved to that namespace. Fixes: hyperium/hyper#3414 --- examples/client.rs | 2 +- src/client/{legacy.rs => legacy/client.rs} | 2 +- src/client/{ => legacy}/connect/dns.rs | 0 src/client/{ => legacy}/connect/http.rs | 0 src/client/{ => legacy}/connect/mod.rs | 0 src/client/legacy/mod.rs | 6 ++++++ src/client/mod.rs | 4 +--- 7 files changed, 9 insertions(+), 5 deletions(-) rename src/client/{legacy.rs => legacy/client.rs} (99%) rename src/client/{ => legacy}/connect/dns.rs (100%) rename src/client/{ => legacy}/connect/http.rs (100%) rename src/client/{ => legacy}/connect/mod.rs (100%) create mode 100644 src/client/legacy/mod.rs diff --git a/examples/client.rs b/examples/client.rs index 1bfa93b..04defac 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -2,7 +2,7 @@ use std::env; use http_body_util::Empty; use hyper::Request; -use hyper_util::client::{connect::HttpConnector, legacy::Client}; +use hyper_util::client::legacy::{connect::HttpConnector, Client}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { diff --git a/src/client/legacy.rs b/src/client/legacy/client.rs similarity index 99% rename from src/client/legacy.rs rename to src/client/legacy/client.rs index f719dc1..bfc25e0 100644 --- a/src/client/legacy.rs +++ b/src/client/legacy/client.rs @@ -18,10 +18,10 @@ use hyper::rt::Timer; use hyper::{body::Body, Method, Request, Response, Uri, Version}; use tracing::{debug, trace, warn}; +use super::super::pool::{self, Ver}; #[cfg(feature = "tcp")] use super::connect::HttpConnector; use super::connect::{Alpn, Connect, Connected, Connection}; -use super::pool::{self, Ver}; use crate::common::{lazy as hyper_lazy, Exec, Lazy, SyncWrapper}; type BoxSendFuture = Pin + Send>>; diff --git a/src/client/connect/dns.rs b/src/client/legacy/connect/dns.rs similarity index 100% rename from src/client/connect/dns.rs rename to src/client/legacy/connect/dns.rs diff --git a/src/client/connect/http.rs b/src/client/legacy/connect/http.rs similarity index 100% rename from src/client/connect/http.rs rename to src/client/legacy/connect/http.rs diff --git a/src/client/connect/mod.rs b/src/client/legacy/connect/mod.rs similarity index 100% rename from src/client/connect/mod.rs rename to src/client/legacy/connect/mod.rs diff --git a/src/client/legacy/mod.rs b/src/client/legacy/mod.rs new file mode 100644 index 0000000..4b7f296 --- /dev/null +++ b/src/client/legacy/mod.rs @@ -0,0 +1,6 @@ +#[cfg(any(feature = "http1", feature = "http2"))] +mod client; +#[cfg(any(feature = "http1", feature = "http2"))] +pub use client::Client; + +pub mod connect; diff --git a/src/client/mod.rs b/src/client/mod.rs index 37d33fc..9803632 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1,8 +1,6 @@ //! HTTP client utilities -//mod client; -pub mod connect; -#[cfg(any(feature = "http1", feature = "http2"))] +/// Legacy implementations of `connect` module and `Client` pub mod legacy; #[doc(hidden)] pub mod pool;