diff options
Diffstat (limited to 'src/sys/signal.rs')
-rw-r--r-- | src/sys/signal.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs index 78ae87c9..d295abcc 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -191,9 +191,10 @@ impl Signal { // implemented, we'll replace this function. #[inline] pub fn from_c_int(signum: libc::c_int) -> Result<Signal> { - match 0 < signum && signum < NSIG { - true => Ok(unsafe { mem::transmute(signum) }), - false => Err(Error::invalid_argument()), + if 0 < signum && signum < NSIG { + Ok(unsafe { mem::transmute(signum) }) + } else { + Err(Error::invalid_argument()) } } } |