mirror of https://github.com/rwf2/Rocket.git
Use 'matches!' macro where possible.
This commit is contained in:
parent
928d51ca6e
commit
f82d760b52
|
@ -167,12 +167,10 @@ impl<L: Listener> Accept for Incoming<L> {
|
|||
/// The delay is useful to handle resource exhaustion errors like ENFILE
|
||||
/// and EMFILE. Otherwise, could enter into tight loop.
|
||||
fn is_connection_error(e: &io::Error) -> bool {
|
||||
match e.kind() {
|
||||
matches!(e.kind(),
|
||||
io::ErrorKind::ConnectionRefused |
|
||||
io::ErrorKind::ConnectionAborted |
|
||||
io::ErrorKind::ConnectionReset => true,
|
||||
_ => false,
|
||||
}
|
||||
io::ErrorKind::ConnectionReset)
|
||||
}
|
||||
|
||||
impl<L: fmt::Debug> fmt::Debug for Incoming<L> {
|
||||
|
|
|
@ -5,9 +5,6 @@ pub fn is_whitespace(&byte: &char) -> bool {
|
|||
|
||||
#[inline]
|
||||
pub fn is_valid_token(&c: &char) -> bool {
|
||||
match c {
|
||||
'0'..='9' | 'A'..='Z' | '^'..='~' | '#'..='\''
|
||||
| '!' | '*' | '+' | '-' | '.' => true,
|
||||
_ => false
|
||||
}
|
||||
matches!(c, '0'..='9' | 'A'..='Z' | '^'..='~' | '#'..='\''
|
||||
| '!' | '*' | '+' | '-' | '.')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue