Use jid's domain_str method instead of format!.

This commit is contained in:
Link Mauve 2023-10-24 17:56:53 +00:00 committed by pep
parent 34b50d32c9
commit 57517692ba

View file

@ -41,7 +41,7 @@ async fn get_tls_stream<S: AsyncRead + AsyncWrite + Unpin>(
async fn get_tls_stream<S: AsyncRead + AsyncWrite + Unpin>(
xmpp_stream: XMPPStream<S>,
) -> Result<TlsStream<S>, Error> {
let domain = format!("{}", xmpp_stream.jid.domain().to_owned());
let domain = xmpp_stream.jid.domain_str().to_owned();
let domain = ServerName::try_from(domain.as_str())?;
let stream = xmpp_stream.into_inner();
let mut root_store = RootCertStore::empty();