Skip to content

Commit 77fb4f9

Browse files
committed
Box large enum fields to reduce size and satisfy clippy
1 parent a6003bf commit 77fb4f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/http/http_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct HttpClient {
2020
#[derive(Debug)]
2121
pub enum ClientStream {
2222
Tcp(TcpStream),
23-
Tls(TlsStream<TcpStream>),
23+
Tls(Box<TlsStream<TcpStream>>),
2424
}
2525

2626
impl AsyncRead for ClientStream {
@@ -60,7 +60,7 @@ impl HttpClient {
6060
let tcp_stream = TcpStream::connect(format!("{}:{}",pared_url.1,pared_url.2)).await?;
6161
let stream = if pared_url.2 == 443 {
6262
let tls_stream = setup_tls_connector(pared_url.1.clone(),tcp_stream).await;
63-
ClientStream::Tls(tls_stream)
63+
ClientStream::Tls(Box::from(tls_stream))
6464
} else {
6565
ClientStream::Tcp(tcp_stream)
6666
};

0 commit comments

Comments
 (0)