From 2002a9d75a4f2be43835cfb1d4f9daaf9b20c1ea Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Tue, 30 Mar 2021 11:06:26 +0200 Subject: [PATCH] tls: use rustls if both native-tls and rustls-tls are enabled (#586) Co-authored-by: Alexis Mousset --- src/transport/smtp/client/tls.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/transport/smtp/client/tls.rs b/src/transport/smtp/client/tls.rs index ed5d1e3..b5d0cb0 100644 --- a/src/transport/smtp/client/tls.rs +++ b/src/transport/smtp/client/tls.rs @@ -128,18 +128,12 @@ impl TlsParametersBuilder { /// depending on which one is available #[cfg(any(feature = "native-tls", feature = "rustls-tls"))] #[cfg_attr(docsrs, doc(cfg(any(feature = "native-tls", feature = "rustls-tls"))))] - // TODO: remove below line once native-tls is supported with async-std - #[allow(unreachable_code)] pub fn build(self) -> Result { - // TODO: remove once native-tls is supported with async-std - #[cfg(all(feature = "rustls-tls", feature = "async-std1"))] + #[cfg(feature = "rustls-tls")] return self.build_rustls(); - #[cfg(feature = "native-tls")] + #[cfg(not(feature = "rustls-tls"))] return self.build_native(); - - #[cfg(not(feature = "native-tls"))] - return self.build_rustls(); } /// Creates a new `TlsParameters` using native-tls with the provided configuration