From b5a6732971b978872a28c2d16dbc8eb48bf5f255 Mon Sep 17 00:00:00 2001 From: Abhijit Gadgil Date: Tue, 7 Jan 2025 13:18:47 +0000 Subject: [PATCH] Fixed lint errors Signed-off-by: Abhijit Gadgil --- components/core/src/tls/rustls_wrapper/readers.rs | 2 +- components/sup-client/src/lib.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/core/src/tls/rustls_wrapper/readers.rs b/components/core/src/tls/rustls_wrapper/readers.rs index 1e40a1e945..2733a6df7b 100644 --- a/components/core/src/tls/rustls_wrapper/readers.rs +++ b/components/core/src/tls/rustls_wrapper/readers.rs @@ -41,7 +41,7 @@ pub fn certificates_from_file(path: impl AsRef) let mut buf = buf_from_file(path.as_ref())?; rustls_pemfile::certs(&mut buf).map(|c| { c.map_err(|_| Error::FailedToReadCerts(path.as_ref().into())) - .map(|x| x.into_owned()) + .map(CertificateDer::into_owned) }) .collect() } diff --git a/components/sup-client/src/lib.rs b/components/sup-client/src/lib.rs index efa938301a..b724b8865b 100644 --- a/components/sup-client/src/lib.rs +++ b/components/sup-client/src/lib.rs @@ -160,10 +160,9 @@ impl SrvClient { let server_name_indication = config.ctl_server_name_indication.clone(); let tcp_stream = if let Some(tls_config) = config.maybe_tls_client_config()?.map(Arc::new) { let domain = server_name_indication.unwrap_or_else(|| addr.domain().to_string()); - let domain: &str = &*domain; debug!("Upgrading ctl-gateway to TLS with domain '{}'", domain); - TcpOrTlsStream::new_tls_client(tcp_stream, tls_config, domain).await - .map_err(|e| e.0)? + TcpOrTlsStream::new_tls_client(tcp_stream, tls_config, &domain).await + .map_err(|e| e.0)? } else { TcpOrTlsStream::new(tcp_stream) };