diff options
Diffstat (limited to 'sys_util/src')
-rw-r--r-- | sys_util/src/handle_eintr.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys_util/src/handle_eintr.rs b/sys_util/src/handle_eintr.rs index d8cc0b3..8e38c09 100644 --- a/sys_util/src/handle_eintr.rs +++ b/sys_util/src/handle_eintr.rs @@ -17,19 +17,13 @@ pub trait InterruptibleResult { impl<T> InterruptibleResult for crate::Result<T> { fn is_interrupted(&self) -> bool { - match self { - Err(e) if e.errno() == EINTR => true, - _ => false, - } + matches!(self, Err(e) if e.errno() == EINTR) } } impl<T> InterruptibleResult for io::Result<T> { fn is_interrupted(&self) -> bool { - match self { - Err(e) if e.kind() == io::ErrorKind::Interrupted => true, - _ => false, - } + matches!(self, Err(e) if e.kind() == io::ErrorKind::Interrupted) } } |