Skip to content

Commit

Permalink
Refactor: simplify match
Browse files Browse the repository at this point in the history
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
  • Loading branch information
NobodyXu and workingjubilee authored Apr 23, 2024
1 parent 0d6baba commit ab7b8db
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,10 @@ mod linux {
)
}) {
Ok(cnt) => Ok(cnt.try_into().unwrap()),
Err(err) if err.raw_os_error() == Some(libc::EOPNOTSUPP) => {
Err(err) if matches!(err.raw_os_error(), Some(libc::EOPNOTSUPP | libc::ENOSYS)) => {
IS_NONBLOCKING_READ_UNSUPPORTED.store(true, Ordering::Relaxed);
Err(io::ErrorKind::Unsupported.into())
}
Err(err) if err.kind() == io::ErrorKind::Unsupported => {
IS_NONBLOCKING_READ_UNSUPPORTED.store(true, Ordering::Relaxed);
Err(err)
}
Err(err) => Err(err),
}
}
Expand Down

0 comments on commit ab7b8db

Please sign in to comment.