Skip to content

Commit

Permalink
Fix clippy warnings for large error types
Browse files Browse the repository at this point in the history
This allows `clippy::result_large_err` on crate level to suppress warnings for:
- `error::Error::Http`
- `handshake::HandshakeError::Interrupted`
- `handshake::server::ErrorResponse`
  • Loading branch information
nickelc authored and daniel-abramov committed Nov 15, 2024
1 parent 7d338cb commit 81b9247
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ pub fn uri_mode(uri: &Uri) -> Result<Mode> {
/// 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<Stream, Req>(
request: Req,
stream: Stream,
Expand All @@ -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<Stream, Req>(
request: Req,
stream: Stream,
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ type TlsHandshakeError<S> = HandshakeError<ClientHandshake<MaybeTlsStream<S>>>;

/// 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<R, S>(
request: R,
stream: S,
Expand All @@ -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<R, S>(
request: R,
stream: S,
Expand Down

0 comments on commit 81b9247

Please sign in to comment.