From 44f502e0503f15f7f03ec3c1e14668bbd9b60b93 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 13 May 2024 23:57:58 -0500 Subject: [PATCH] awc: gate TlsConnectorService behind any feature that uses it (#3350) --- awc/CHANGES.md | 1 + awc/src/client/connector.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 507c8a08..46939a7c 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -3,6 +3,7 @@ ## Unreleased - Minimum supported Rust version (MSRV) is now 1.72. +- Fix warning on 1.78 due to unused TlsConnectorService struct ## 3.4.0 diff --git a/awc/src/client/connector.rs b/awc/src/client/connector.rs index 94629b95..b66e13ec 100644 --- a/awc/src/client/connector.rs +++ b/awc/src/client/connector.rs @@ -649,6 +649,14 @@ where /// service for establish tcp connection and do client tls handshake. /// operation is canceled when timeout limit reached. +#[cfg(any( + feature = "dangerous-h2c", + feature = "openssl", + feature = "rustls-0_20", + feature = "rustls-0_21", + feature = "rustls-0_22-webpki-roots", + feature = "rustls-0_22-native-roots", +))] struct TlsConnectorService { /// TCP connection is canceled on `TcpConnectorInnerService`'s timeout setting. tcp_service: Tcp, @@ -659,6 +667,14 @@ struct TlsConnectorService { timeout: Duration, } +#[cfg(any( + feature = "dangerous-h2c", + feature = "openssl", + feature = "rustls-0_20", + feature = "rustls-0_21", + feature = "rustls-0_22-webpki-roots", + feature = "rustls-0_22-native-roots", +))] impl Service for TlsConnectorService where Tcp: