Skip to content

Commit ab7b8db

Browse files
Refactor: simplify match
Co-authored-by: Jubilee <[email protected]>
1 parent 0d6baba commit ab7b8db

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Diff for: src/unix.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,10 @@ mod linux {
460460
)
461461
}) {
462462
Ok(cnt) => Ok(cnt.try_into().unwrap()),
463-
Err(err) if err.raw_os_error() == Some(libc::EOPNOTSUPP) => {
463+
Err(err) if matches!(err.raw_os_error(), Some(libc::EOPNOTSUPP | libc::ENOSYS)) => {
464464
IS_NONBLOCKING_READ_UNSUPPORTED.store(true, Ordering::Relaxed);
465465
Err(io::ErrorKind::Unsupported.into())
466466
}
467-
Err(err) if err.kind() == io::ErrorKind::Unsupported => {
468-
IS_NONBLOCKING_READ_UNSUPPORTED.store(true, Ordering::Relaxed);
469-
Err(err)
470-
}
471467
Err(err) => Err(err),
472468
}
473469
}

0 commit comments

Comments
 (0)