From 222c20dd2962189476599a2ed08d8a611d935b03 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 16 Dec 2017 10:42:55 -0800 Subject: [PATCH] Replace boolean match with if/else --- src/sys/signal.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sys/signal.rs b/src/sys/signal.rs index 78ae87c9fa..d295abcc7c 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 { - 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()) } } }