File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -315,14 +315,10 @@ impl From<PacketCodecError> for IoError {
315
315
fn from ( err : PacketCodecError ) -> Self {
316
316
match err {
317
317
PacketCodecError :: Io ( err) => err. into ( ) ,
318
- PacketCodecError :: PacketTooLarge => {
319
- io:: Error :: new ( io:: ErrorKind :: Other , "packet too large" ) . into ( )
320
- }
321
- PacketCodecError :: PacketsOutOfSync => {
322
- io:: Error :: new ( io:: ErrorKind :: Other , "packet out of order" ) . into ( )
323
- }
318
+ PacketCodecError :: PacketTooLarge => io:: Error :: other ( "packet too large" ) . into ( ) ,
319
+ PacketCodecError :: PacketsOutOfSync => io:: Error :: other ( "packet out of order" ) . into ( ) ,
324
320
PacketCodecError :: BadCompressedPacketHeader => {
325
- io:: Error :: new ( io :: ErrorKind :: Other , "bad compressed packet header" ) . into ( )
321
+ io:: Error :: other ( "bad compressed packet header" ) . into ( )
326
322
}
327
323
}
328
324
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ use std::{
26
26
future:: Future ,
27
27
io:: {
28
28
self ,
29
- ErrorKind :: { BrokenPipe , NotConnected , Other } ,
29
+ ErrorKind :: { BrokenPipe , NotConnected } ,
30
30
} ,
31
31
mem:: replace,
32
32
net:: SocketAddr ,
@@ -141,7 +141,7 @@ impl Future for CheckTcpStream<'_> {
141
141
let mut buf = [ 0_u8 ; 1 ] ;
142
142
match self . 0 . try_read ( & mut buf) {
143
143
Ok ( 0 ) => Poll :: Ready ( Err ( io:: Error :: new ( BrokenPipe , "broken pipe" ) ) ) ,
144
- Ok ( _) => Poll :: Ready ( Err ( io:: Error :: new ( Other , "stream should be empty" ) ) ) ,
144
+ Ok ( _) => Poll :: Ready ( Err ( io:: Error :: other ( "stream should be empty" ) ) ) ,
145
145
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => Poll :: Ready ( Ok ( ( ) ) ) ,
146
146
Err ( err) => Poll :: Ready ( Err ( err) ) ,
147
147
}
Original file line number Diff line number Diff line change @@ -100,8 +100,8 @@ where
100
100
self . conn
101
101
. get_pending_result ( )
102
102
. map ( |pending_result| match pending_result {
103
- Some ( PendingResult :: Pending ( meta) ) => meta. columns ( ) . len ( ) > 0 ,
104
- Some ( PendingResult :: Taken ( meta) ) => meta. columns ( ) . len ( ) > 0 ,
103
+ Some ( PendingResult :: Pending ( meta) ) => ! meta. columns ( ) . is_empty ( ) ,
104
+ Some ( PendingResult :: Taken ( meta) ) => ! meta. columns ( ) . is_empty ( ) ,
105
105
None => false ,
106
106
} )
107
107
. unwrap_or ( false )
You can’t perform that action at this time.
0 commit comments