fix: feature gate internal TransportBuilder::tls to avoid recursive call site (#1083)

This commit is contained in:
Paolo Barbolini
2025-05-01 15:09:07 +02:00
committed by GitHub
parent 9504b7f45c
commit de3ab006e2

View File

@@ -13,6 +13,7 @@ use super::{
pub(crate) trait TransportBuilder { pub(crate) trait TransportBuilder {
fn new<T: Into<String>>(server: T) -> Self; fn new<T: Into<String>>(server: T) -> Self;
#[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))]
fn tls(self, tls: super::Tls) -> Self; fn tls(self, tls: super::Tls) -> Self;
fn port(self, port: u16) -> Self; fn port(self, port: u16) -> Self;
fn credentials(self, credentials: Credentials) -> Self; fn credentials(self, credentials: Credentials) -> Self;
@@ -24,6 +25,7 @@ impl TransportBuilder for SmtpTransportBuilder {
Self::new(server) Self::new(server)
} }
#[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))]
fn tls(self, tls: super::Tls) -> Self { fn tls(self, tls: super::Tls) -> Self {
self.tls(tls) self.tls(tls)
} }
@@ -47,6 +49,7 @@ impl TransportBuilder for AsyncSmtpTransportBuilder {
Self::new(server) Self::new(server)
} }
#[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))]
fn tls(self, tls: super::Tls) -> Self { fn tls(self, tls: super::Tls) -> Self {
self.tls(tls) self.tls(tls)
} }