Add a missing impl<T> IntoEndpoint for (T, native_tls::TlsConnector) for the any engine (#1885)

This commit is contained in:
Rushmore Mushambi 2023-04-29 18:21:19 +02:00 committed by GitHub
parent 91e949248d
commit 59947749e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,6 +140,20 @@ impl IntoEndpoint for String {
}
}
#[cfg(feature = "native-tls")]
#[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))]
impl<T> IntoEndpoint for (T, native_tls::TlsConnector)
where
T: Into<String>,
{
fn into_endpoint(self) -> Result<Endpoint> {
let (address, config) = self;
let mut address = address.into().into_endpoint()?;
address.tls_config = Some(Tls::Native(config));
Ok(address)
}
}
#[cfg(feature = "rustls")]
#[cfg_attr(docsrs, doc(cfg(feature = "rustls")))]
impl<T> IntoEndpoint for (T, rustls::ClientConfig)