File tree Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Expand file tree Collapse file tree 4 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 @@ -149,7 +149,7 @@ pub enum PathOrBuf<'a> {
149
149
150
150
impl < ' a > PathOrBuf < ' a > {
151
151
/// Will either read data from disk or return the buffered data.
152
- pub async fn read ( & self ) -> io:: Result < Cow < [ u8 ] > > {
152
+ pub async fn read ( & self ) -> io:: Result < Cow < ' _ , [ u8 ] > > {
153
153
match self {
154
154
PathOrBuf :: Path ( x) => tokio:: fs:: read ( x. as_ref ( ) ) . await . map ( Cow :: Owned ) ,
155
155
PathOrBuf :: Buf ( x) => Ok ( Cow :: Borrowed ( x. as_ref ( ) ) ) ,
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 )
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ impl<'a> Transaction<'a> {
154
154
}
155
155
156
156
if let Some ( isolation_level) = isolation_level {
157
- let query = format ! ( "SET TRANSACTION ISOLATION LEVEL {}" , isolation_level ) ;
157
+ let query = format ! ( "SET TRANSACTION ISOLATION LEVEL {isolation_level}" ) ;
158
158
conn. as_mut ( ) . query_drop ( query) . await ?;
159
159
}
160
160
You can’t perform that action at this time.
0 commit comments