From fb32e98f862771388688f0fd678e004a84df1d7d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 29 Jul 2019 10:28:09 -0700 Subject: [PATCH] sys_util: drop redundant empty return type rustfmt incorrectly formats the `handler` parameter in register_signal_handler in a way that actually breaks compilation. This bug has been reported upstream already, but it is not fixed yet on the version of rustfmt available with stable rust: https://github.com/rust-lang/rustfmt/issues/3673 However, the empty return type can just be omitted in this case, which avoids the rustfmt bug. BUG=None TEST=`bin/fmt --check` passes with Rust 1.36.0 Change-Id: I75c49c66f1db9cb6ae73cc0f6f3e66351176c474 Signed-off-by: Daniel Verkamp Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1724849 Reviewed-by: Zach Reizner Tested-by: kokoro --- sys_util/src/signal.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys_util/src/signal.rs b/sys_util/src/signal.rs index 882da90989..821f0f6a80 100644 --- a/sys_util/src/signal.rs +++ b/sys_util/src/signal.rs @@ -100,10 +100,7 @@ fn valid_signal_num(num: c_int) -> bool { /// /// This is considered unsafe because the given handler will be called asynchronously, interrupting /// whatever the thread was doing and therefore must only do async-signal-safe operations. -pub unsafe fn register_signal_handler( - num: c_int, - handler: extern "C" fn() -> (), -) -> errno::Result<()> { +pub unsafe fn register_signal_handler(num: c_int, handler: extern "C" fn()) -> errno::Result<()> { if !valid_signal_num(num) { return Err(errno::Error::new(EINVAL)); }