Skip to content

Commit 39705af

Browse files
committed
fix(proxy): use nested or-patterns to satisfy clippy lint
Signed-off-by: Quinn Burdine <[email protected]> Signed-off-by: politerealism <[email protected]>
1 parent abfe555 commit 39705af

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • crates/openshell-supervisor-network/src

‎crates/openshell-supervisor-network/src/proxy.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@ enum AcceptErrorClass {
375375
#[cfg(unix)]
376376
fn classify_accept_error(err: &std::io::Error) -> AcceptErrorClass {
377377
match err.raw_os_error() {
378-
Some(libc::EMFILE) | Some(libc::ENFILE) => AcceptErrorClass::Transient,
379-
Some(libc::ECONNABORTED) | Some(libc::ECONNRESET) => AcceptErrorClass::Transient,
380-
Some(libc::EINTR) => AcceptErrorClass::Transient,
381-
Some(libc::EBADF) | Some(libc::EINVAL) | Some(libc::ENOTSOCK) => AcceptErrorClass::Terminal,
378+
Some(libc::EMFILE | libc::ENFILE | libc::ECONNABORTED | libc::ECONNRESET | libc::EINTR) => {
379+
AcceptErrorClass::Transient
380+
}
381+
Some(libc::EBADF | libc::EINVAL | libc::ENOTSOCK) => AcceptErrorClass::Terminal,
382382
_ => AcceptErrorClass::Unknown,
383383
}
384384
}
@@ -390,7 +390,7 @@ fn classify_accept_error(_err: &std::io::Error) -> AcceptErrorClass {
390390

391391
#[cfg(unix)]
392392
fn is_fd_exhaustion_error(err: &std::io::Error) -> bool {
393-
matches!(err.raw_os_error(), Some(libc::EMFILE) | Some(libc::ENFILE))
393+
matches!(err.raw_os_error(), Some(libc::EMFILE | libc::ENFILE))
394394
}
395395

396396
#[cfg(not(unix))]

0 commit comments

Comments
 (0)