From d5f1f2c925344e8e3fafadea283c4e619d3343ce Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Fri, 2 Sep 2022 15:58:16 +0200 Subject: [PATCH] cargo clippy --- src/tcp_relay_server/relay_ws.rs | 4 +--- src/tcp_relay_server/tls_cert_client_verifier.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tcp_relay_server/relay_ws.rs b/src/tcp_relay_server/relay_ws.rs index 6b0ac19..ded164a 100644 --- a/src/tcp_relay_server/relay_ws.rs +++ b/src/tcp_relay_server/relay_ws.rs @@ -108,9 +108,7 @@ impl StreamHandler> for RelayWS { Ok(ws::Message::Text(text)) => ctx.text(text), Ok(ws::Message::Close(_reason)) => ctx.stop(), Ok(ws::Message::Binary(data)) => { - if let Err(e) = - futures::executor::block_on(self.tcp_write.write_all(&data.to_vec())) - { + if let Err(e) = futures::executor::block_on(self.tcp_write.write_all(&data)) { log::error!("Failed to forward some data, closing connection! {:?}", e); ctx.stop(); } diff --git a/src/tcp_relay_server/tls_cert_client_verifier.rs b/src/tcp_relay_server/tls_cert_client_verifier.rs index 36c0bfa..4ef54e3 100644 --- a/src/tcp_relay_server/tls_cert_client_verifier.rs +++ b/src/tcp_relay_server/tls_cert_client_verifier.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use std::time::SystemTime; -use rustls::{Certificate, DistinguishedNames, Error, RootCertStore}; use rustls::internal::msgs::enums::AlertDescription; use rustls::server::{AllowAnyAuthenticatedClient, ClientCertVerified, ClientCertVerifier}; +use rustls::{Certificate, DistinguishedNames, Error, RootCertStore}; use x509_parser::prelude::{CertificateRevocationList, FromDer, X509Certificate}; use crate::base::cert_utils::parse_pem_certificates;