Skip to content

Commit c8d9969

Browse files
authored
Merge pull request #714 from hatoo/clippy
clippy
2 parents 14bb9a8 + 4ca2edf commit c8d9969

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/client.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ enum Stream {
257257
#[cfg(all(feature = "native-tls", not(feature = "rustls")))]
258258
Tls(tokio_native_tls::TlsStream<TcpStream>),
259259
#[cfg(feature = "rustls")]
260-
Tls(tokio_rustls::client::TlsStream<TcpStream>),
260+
// Box for large variant
261+
Tls(Box<tokio_rustls::client::TlsStream<TcpStream>>),
261262
#[cfg(unix)]
262263
Unix(tokio::net::UnixStream),
263264
#[cfg(feature = "vsock")]
@@ -500,7 +501,7 @@ impl Client {
500501
stream: S,
501502
url: &Url,
502503
is_http2: bool,
503-
) -> Result<tokio_rustls::client::TlsStream<S>, ClientError>
504+
) -> Result<Box<tokio_rustls::client::TlsStream<S>>, ClientError>
504505
where
505506
S: AsyncRead + AsyncWrite + Unpin,
506507
{
@@ -511,7 +512,7 @@ impl Client {
511512
)?;
512513
let stream = connector.connect(domain.to_owned(), stream).await?;
513514

514-
Ok(stream)
515+
Ok(Box::new(stream))
515516
}
516517

517518
async fn client_http1<R: Rng>(

0 commit comments

Comments
 (0)