From de4b3e389109f820231b203bf370c9646f66e2ce Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Sun, 4 Jul 2021 15:01:55 -0700 Subject: [PATCH] Make 'tls' its own module. --- core/http/src/lib.rs | 7 ++++--- core/http/src/{tls.rs => tls/mod.rs} | 0 core/lib/src/config/tls.rs | 4 ++-- core/lib/src/server.rs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) rename core/http/src/{tls.rs => tls/mod.rs} (100%) diff --git a/core/http/src/lib.rs b/core/http/src/lib.rs index 6ec8e2a6..cdf2c9e7 100644 --- a/core/http/src/lib.rs +++ b/core/http/src/lib.rs @@ -42,15 +42,16 @@ pub mod uncased { #[doc(hidden)] #[path = "."] pub mod private { - #[cfg(feature = "tls")] - pub mod tls; - pub use crate::parse::Indexed; pub use smallvec::{SmallVec, Array}; pub use crate::listener::{Incoming, Listener, Connection, bind_tcp}; pub use cookie; } +#[doc(hidden)] +#[cfg(feature = "tls")] +pub mod tls; + pub use crate::method::Method; pub use crate::status::{Status, StatusClass}; pub use crate::raw_str::{RawStr, RawStrBuf}; diff --git a/core/http/src/tls.rs b/core/http/src/tls/mod.rs similarity index 100% rename from core/http/src/tls.rs rename to core/http/src/tls/mod.rs diff --git a/core/lib/src/config/tls.rs b/core/lib/src/config/tls.rs index 89bc7a8b..7807244c 100644 --- a/core/lib/src/config/tls.rs +++ b/core/lib/src/config/tls.rs @@ -382,8 +382,8 @@ impl TlsConfig { #[cfg(feature = "tls")] mod with_tls_feature { - use crate::http::private::tls::rustls::SupportedCipherSuite as RustlsCipher; - use crate::http::private::tls::rustls::ciphersuite as rustls; + use crate::http::tls::rustls::SupportedCipherSuite as RustlsCipher; + use crate::http::tls::rustls::ciphersuite as rustls; use super::*; diff --git a/core/lib/src/server.rs b/core/lib/src/server.rs index 94b69ddd..08731c32 100644 --- a/core/lib/src/server.rs +++ b/core/lib/src/server.rs @@ -367,7 +367,7 @@ impl Rocket { #[cfg(feature = "tls")] if let Some(ref config) = self.config.tls { - use crate::http::private::tls::bind_tls; + use crate::http::tls::bind_tls; let (certs, key) = config.to_readers().map_err(ErrorKind::Io)?; let ciphers = config.rustls_ciphers();