tokio-xmpp: clippy run

skip-changelog

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2025-04-07 22:57:33 +02:00
commit 23c947d081
14 changed files with 54 additions and 73 deletions

View file

@ -113,7 +113,7 @@ impl DnsConfig {
#[cfg(feature = "dns")]
async fn resolve_srv(host: &str, srv: &str, fallback_port: u16) -> Result<TcpStream, Error> {
let ascii_domain = idna::domain_to_ascii(&host)?;
let ascii_domain = idna::domain_to_ascii(host)?;
if let Ok(ip) = ascii_domain.parse() {
debug!("Attempting connection to {ip}:{fallback_port}");
@ -148,7 +148,7 @@ impl DnsConfig {
#[cfg(feature = "dns")]
async fn resolve_no_srv(host: &str, port: u16) -> Result<TcpStream, Error> {
let ascii_domain = idna::domain_to_ascii(&host)?;
let ascii_domain = idna::domain_to_ascii(host)?;
if let Ok(ip) = ascii_domain.parse() {
return Ok(TcpStream::connect(&SocketAddr::new(ip, port)).await?);

View file

@ -118,7 +118,7 @@ impl ServerConnector for StartTlsServerConnector {
channel_binding,
))
} else {
Err(crate::Error::Protocol(ProtocolError::NoTls).into())
Err(crate::Error::Protocol(ProtocolError::NoTls))
}
}
}
@ -168,7 +168,7 @@ async fn get_tls_stream<S: AsyncRead + AsyncWrite + Unpin + AsRawFd>(
let tls_stream = TlsConnector::from(Arc::new(config))
.connect(domain, stream)
.await
.map_err(|e| Error::from(crate::Error::Io(e)))?;
.map_err(crate::Error::Io)?;
// Extract the channel-binding information before we hand the stream over to ktls.
let (_, connection) = tls_stream.get_ref();
@ -178,7 +178,7 @@ async fn get_tls_stream<S: AsyncRead + AsyncWrite + Unpin + AsRawFd>(
let data = vec![0u8; 32];
let data = connection
.export_keying_material(data, b"EXPORTER-Channel-Binding", None)
.map_err(|e| StartTlsError::Tls(e))?;
.map_err(StartTlsError::Tls)?;
ChannelBinding::TlsExporter(data)
}
_ => ChannelBinding::None,