File tree Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,7 @@ impl Decoder {
9494 // methods
9595
9696 pub fn is_eof ( & self ) -> bool {
97- match self . kind {
98- Length ( 0 ) | Chunked ( ChunkedState :: End , _) | Eof ( true ) => true ,
99- _ => false ,
100- }
97+ matches ! ( self . kind, Length ( 0 ) | Chunked ( ChunkedState :: End , _) | Eof ( true ) )
10198 }
10299
103100 pub fn decode < R : MemRead > (
Original file line number Diff line number Diff line change @@ -68,10 +68,7 @@ impl Encoder {
6868 }
6969
7070 pub fn is_eof ( & self ) -> bool {
71- match self . kind {
72- Kind :: Length ( 0 ) => true ,
73- _ => false ,
74- }
71+ matches ! ( self . kind, Kind :: Length ( 0 ) )
7572 }
7673
7774 #[ cfg( feature = "server" ) ]
Original file line number Diff line number Diff line change @@ -202,12 +202,9 @@ impl Accept for AddrIncoming {
202202/// The timeout is useful to handle resource exhaustion errors like ENFILE
203203/// and EMFILE. Otherwise, could enter into tight loop.
204204fn is_connection_error ( e : & io:: Error ) -> bool {
205- match e. kind ( ) {
206- io:: ErrorKind :: ConnectionRefused
205+ matches ! ( e. kind( ) , io:: ErrorKind :: ConnectionRefused
207206 | io:: ErrorKind :: ConnectionAborted
208- | io:: ErrorKind :: ConnectionReset => true ,
209- _ => false ,
210- }
207+ | io:: ErrorKind :: ConnectionReset )
211208}
212209
213210impl fmt:: Debug for AddrIncoming {
You can’t perform that action at this time.
0 commit comments