diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-12-16 10:42:55 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-20 07:05:04 -0800 |
commit | 8db68be6ba9c25c0955f4febeb78b31030ba7603 (patch) | |
tree | 83caae312da5c8c4e2736f1e2da6e5382dc53e1d | |
parent | 68baedc06adfbb59533afdf11d60e84f12d2a01e (diff) | |
download | nix-8db68be6ba9c25c0955f4febeb78b31030ba7603.zip |
Replace boolean match with if/else
-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()) } } } |