@@ -202,6 +202,7 @@ impl TcpStream {
202
202
203
203
/// Check whether the stream is connected or not
204
204
#[ must_use]
205
+ #[ allow( irrefutable_let_patterns) ]
205
206
pub fn is_connected ( & self ) -> bool {
206
207
if let Self :: Plain ( _, connected) = self {
207
208
* connected
@@ -214,13 +215,14 @@ impl TcpStream {
214
215
/// - Ok(true) if connected
215
216
/// - Ok(false) if connecting
216
217
/// - Err(_) if an error is encountered
218
+ #[ allow( irrefutable_let_patterns) ]
217
219
pub fn try_connect ( & mut self ) -> io:: Result < bool > {
218
220
if self . is_connected ( ) {
219
221
return Ok ( true ) ;
220
222
}
221
223
match self . is_writable ( ) {
222
224
Ok ( ( ) ) => {
223
- if let Self :: Plain ( _, ref mut connected) = self {
225
+ if let Self :: Plain ( _, connected) = self {
224
226
* connected = true ;
225
227
}
226
228
Ok ( true )
@@ -490,13 +492,13 @@ impl DerefMut for TcpStream {
490
492
macro_rules! fwd_impl {
491
493
( $self: ident, $method: ident, $( $args: expr) ,* ) => {
492
494
match $self {
493
- TcpStream :: Plain ( ref mut plain, _) => plain. $method( $( $args) ,* ) ,
495
+ TcpStream :: Plain ( plain, _) => plain. $method( $( $args) ,* ) ,
494
496
#[ cfg( feature = "native-tls" ) ]
495
- TcpStream :: NativeTls ( ref mut tls) => tls. $method( $( $args) ,* ) ,
497
+ TcpStream :: NativeTls ( tls) => tls. $method( $( $args) ,* ) ,
496
498
#[ cfg( feature = "openssl" ) ]
497
- TcpStream :: OpenSsl ( ref mut tls) => tls. $method( $( $args) ,* ) ,
499
+ TcpStream :: OpenSsl ( tls) => tls. $method( $( $args) ,* ) ,
498
500
#[ cfg( feature = "rustls-common" ) ]
499
- TcpStream :: Rustls ( ref mut tls) => tls. $method( $( $args) ,* ) ,
501
+ TcpStream :: Rustls ( tls) => tls. $method( $( $args) ,* ) ,
500
502
}
501
503
} ;
502
504
}
0 commit comments