From 81b92476b59b8fa4ab715ffe81b83311eb92b2ec Mon Sep 17 00:00:00 2001 From: Constantin Nickel Date: Wed, 13 Nov 2024 14:05:42 +0100 Subject: [PATCH] Fix clippy warnings for large error types This allows `clippy::result_large_err` on crate level to suppress warnings for: - `error::Error::Http` - `handshake::HandshakeError::Interrupted` - `handshake::server::ErrorResponse` --- src/client.rs | 2 -- src/lib.rs | 3 +++ src/tls.rs | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client.rs b/src/client.rs index 293673b2..36b2027c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -155,7 +155,6 @@ pub fn uri_mode(uri: &Uri) -> Result { /// Use this function if you need a nonblocking handshake support or if you /// want to use a custom stream like `mio::net::TcpStream` or `openssl::ssl::SslStream`. /// Any stream supporting `Read + Write` will do. -#[allow(clippy::result_large_err)] pub fn client_with_config( request: Req, stream: Stream, @@ -173,7 +172,6 @@ where /// Use this function if you need a nonblocking handshake support or if you /// want to use a custom stream like `mio::net::TcpStream` or `openssl::ssl::SslStream`. /// Any stream supporting `Read + Write` will do. -#[allow(clippy::result_large_err)] pub fn client( request: Req, stream: Stream, diff --git a/src/lib.rs b/src/lib.rs index 8c593cdf..6b79d5be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,9 @@ unused_imports, unused_import_braces )] +// This can be removed when `error::Error::Http`, `handshake::HandshakeError::Interrupted` and +// `handshake::server::ErrorResponse` are boxed. +#![allow(clippy::result_large_err)] #[cfg(feature = "handshake")] pub use http; diff --git a/src/tls.rs b/src/tls.rs index 58560151..10fa8291 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -175,7 +175,6 @@ type TlsHandshakeError = HandshakeError>>; /// Creates a WebSocket handshake from a request and a stream, /// upgrading the stream to TLS if required. -#[allow(clippy::result_large_err)] pub fn client_tls( request: R, stream: S, @@ -192,7 +191,6 @@ where /// be created. /// /// Please refer to [`client_tls()`] for more details. -#[allow(clippy::result_large_err)] pub fn client_tls_with_config( request: R, stream: S,