Skip to content

Commit

Permalink
rename old tls methods that didn't change after old refactor
Browse files Browse the repository at this point in the history
tls connectors can also be used in non-http contexts,
so having http still in the constructor names was confusing
  • Loading branch information
GlenDC committed Oct 20, 2024
1 parent 57c70c5 commit 7b98232
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions rama-http-backend/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ where
}
};
HttpConnector::new(
TlsConnector::http_auto(transport_connector)
.with_connector_data(tls_connector_data),
TlsConnector::auto(transport_connector).with_connector_data(tls_connector_data),
)
};
#[cfg(not(any(feature = "rustls", feature = "boring")))]
Expand Down
10 changes: 5 additions & 5 deletions rama-tls/src/boring/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl TlsConnectorLayer<ConnectorKindAuto> {
/// Creates a new [`TlsConnectorLayer`] which will establish
/// a secure connection if the request demands it,
/// otherwise it will forward the pre-established inner connection.
pub fn http_auto() -> Self {
pub fn auto() -> Self {
Self {
connector_data: None,
kind: ConnectorKindAuto,
Expand All @@ -78,7 +78,7 @@ impl TlsConnectorLayer<ConnectorKindAuto> {
impl TlsConnectorLayer<ConnectorKindSecure> {
/// Creates a new [`TlsConnectorLayer`] which will always
/// establish a secure connection regardless of the request it is for.
pub fn https() -> Self {
pub fn secure() -> Self {
Self {
connector_data: None,
kind: ConnectorKindSecure,
Expand Down Expand Up @@ -111,7 +111,7 @@ impl<K: Clone, S> Layer<S> for TlsConnectorLayer<K> {

impl Default for TlsConnectorLayer<ConnectorKindAuto> {
fn default() -> Self {
Self::http_auto()
Self::auto()
}
}

Expand Down Expand Up @@ -190,15 +190,15 @@ impl<S> TlsConnector<S, ConnectorKindAuto> {
/// Creates a new [`TlsConnector`] which will establish
/// a secure connection if the request demands it,
/// otherwise it will forward the pre-established inner connection.
pub const fn http_auto(inner: S) -> Self {
pub const fn auto(inner: S) -> Self {
Self::new(inner, ConnectorKindAuto)
}
}

impl<S> TlsConnector<S, ConnectorKindSecure> {
/// Creates a new [`TlsConnector`] which will always
/// establish a secure connection regardless of the request it is for.
pub const fn https(inner: S) -> Self {
pub const fn secure(inner: S) -> Self {
Self::new(inner, ConnectorKindSecure)
}
}
Expand Down
10 changes: 5 additions & 5 deletions rama-tls/src/rustls/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl TlsConnectorLayer<ConnectorKindAuto> {
/// Creates a new [`TlsConnectorLayer`] which will establish
/// a secure connection if the request demands it,
/// otherwise it will forward the pre-established inner connection.
pub fn http_auto() -> Self {
pub fn auto() -> Self {
Self {
connector_data: None,
kind: ConnectorKindAuto,
Expand All @@ -80,7 +80,7 @@ impl TlsConnectorLayer<ConnectorKindAuto> {
impl TlsConnectorLayer<ConnectorKindSecure> {
/// Creates a new [`TlsConnectorLayer`] which will always
/// establish a secure connection regardless of the request it is for.
pub fn https() -> Self {
pub fn secure() -> Self {
Self {
connector_data: None,
kind: ConnectorKindSecure,
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<K: Clone, S> Layer<S> for TlsConnectorLayer<K> {

impl Default for TlsConnectorLayer<ConnectorKindAuto> {
fn default() -> Self {
Self::http_auto()
Self::auto()
}
}

Expand Down Expand Up @@ -192,15 +192,15 @@ impl<S> TlsConnector<S, ConnectorKindAuto> {
/// Creates a new [`TlsConnector`] which will establish
/// a secure connection if the request demands it,
/// otherwise it will forward the pre-established inner connection.
pub fn http_auto(inner: S) -> Self {
pub fn auto(inner: S) -> Self {
Self::new(inner, ConnectorKindAuto)
}
}

impl<S> TlsConnector<S, ConnectorKindSecure> {
/// Creates a new [`TlsConnector`] which will always
/// establish a secure connection regardless of the request it is for.
pub fn https(inner: S) -> Self {
pub fn secure(inner: S) -> Self {
Self::new(inner, ConnectorKindSecure)
}
}
Expand Down

0 comments on commit 7b98232

Please sign in to comment.