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;