From 7b982324f0624a3c1c22a8f4d64a5f043211749e Mon Sep 17 00:00:00 2001 From: glendc Date: Sun, 20 Oct 2024 21:38:22 +0200 Subject: [PATCH] rename old tls methods that didn't change after old refactor tls connectors can also be used in non-http contexts, so having http still in the constructor names was confusing --- rama-http-backend/src/client/mod.rs | 3 +-- rama-tls/src/boring/client/connector.rs | 10 +++++----- rama-tls/src/rustls/client/connector.rs | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/rama-http-backend/src/client/mod.rs b/rama-http-backend/src/client/mod.rs index 59bd17cb..bd6aebfa 100644 --- a/rama-http-backend/src/client/mod.rs +++ b/rama-http-backend/src/client/mod.rs @@ -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")))] diff --git a/rama-tls/src/boring/client/connector.rs b/rama-tls/src/boring/client/connector.rs index 040192ce..33b336a9 100644 --- a/rama-tls/src/boring/client/connector.rs +++ b/rama-tls/src/boring/client/connector.rs @@ -67,7 +67,7 @@ impl TlsConnectorLayer { /// 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, @@ -78,7 +78,7 @@ impl TlsConnectorLayer { impl TlsConnectorLayer { /// 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, @@ -111,7 +111,7 @@ impl Layer for TlsConnectorLayer { impl Default for TlsConnectorLayer { fn default() -> Self { - Self::http_auto() + Self::auto() } } @@ -190,7 +190,7 @@ impl TlsConnector { /// 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) } } @@ -198,7 +198,7 @@ impl TlsConnector { impl TlsConnector { /// 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) } } diff --git a/rama-tls/src/rustls/client/connector.rs b/rama-tls/src/rustls/client/connector.rs index 75c51b67..3a7692fc 100644 --- a/rama-tls/src/rustls/client/connector.rs +++ b/rama-tls/src/rustls/client/connector.rs @@ -69,7 +69,7 @@ impl TlsConnectorLayer { /// 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, @@ -80,7 +80,7 @@ impl TlsConnectorLayer { impl TlsConnectorLayer { /// 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, @@ -113,7 +113,7 @@ impl Layer for TlsConnectorLayer { impl Default for TlsConnectorLayer { fn default() -> Self { - Self::http_auto() + Self::auto() } } @@ -192,7 +192,7 @@ impl TlsConnector { /// 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) } } @@ -200,7 +200,7 @@ impl TlsConnector { impl TlsConnector { /// 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) } }