Skip to content

Commit e09a935

Browse files
committed
don't box unnecessarily
1 parent a8f92e0 commit e09a935

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(missing_docs)]
2+
#![allow(clippy::result_large_err, clippy::large_enum_variant)]
23

34
//! # Connector similar to openssl or native-tls for rustls
45
//!
@@ -246,7 +247,7 @@ impl<S: Read + Send + Write + 'static> MidHandshakeTlsStream<S> {
246247
if let Err(e) = self.session.complete_io(&mut self.stream) {
247248
if e.kind() == io::ErrorKind::WouldBlock {
248249
if self.session.is_handshaking() {
249-
return Err(HandshakeError::WouldBlock(Box::new(self)));
250+
return Err(HandshakeError::WouldBlock(self));
250251
}
251252
} else {
252253
return Err(e.into());
@@ -266,7 +267,7 @@ impl<S: Read + Write> fmt::Display for MidHandshakeTlsStream<S> {
266267
pub enum HandshakeError<S: Read + Write + Send + 'static> {
267268
/// We hit WouldBlock during handshake.
268269
/// Note that this is not a critical failure, you should be able to call handshake again once the stream is ready to perform I/O.
269-
WouldBlock(Box<MidHandshakeTlsStream<S>>),
270+
WouldBlock(MidHandshakeTlsStream<S>),
270271
/// We hit a critical failure.
271272
Failure(io::Error),
272273
}

0 commit comments

Comments
 (0)