From c455e86bd4fa1e27ffb09591ea80248365391d87 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sun, 3 Sep 2023 20:13:18 +0900 Subject: [PATCH] chore(tls): Remove unused tls field when tls feature is not used --- tonic/src/transport/service/connector.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tonic/src/transport/service/connector.rs b/tonic/src/transport/service/connector.rs index 6645696ea..801ac65cc 100644 --- a/tonic/src/transport/service/connector.rs +++ b/tonic/src/transport/service/connector.rs @@ -12,20 +12,15 @@ pub(crate) struct Connector { inner: C, #[cfg(feature = "tls")] tls: Option, - #[cfg(not(feature = "tls"))] - #[allow(dead_code)] - tls: Option<()>, } impl Connector { - #[cfg(not(feature = "tls"))] - pub(crate) fn new(inner: C) -> Self { - Self { inner, tls: None } - } - - #[cfg(feature = "tls")] - pub(crate) fn new(inner: C, tls: Option) -> Self { - Self { inner, tls } + pub(crate) fn new(inner: C, #[cfg(feature = "tls")] tls: Option) -> Self { + Self { + inner, + #[cfg(feature = "tls")] + tls, + } } #[cfg(feature = "tls-roots-common")]