From d37261529ca2a62924d2d48a997a8525f6bd58bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sun, 11 Apr 2021 04:50:31 +1200 Subject: [PATCH] Moar windows fixes --- src/signal.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/signal.rs b/src/signal.rs index e99993fd..962b38d4 100644 --- a/src/signal.rs +++ b/src/signal.rs @@ -28,23 +28,24 @@ pub enum Signal { SIGUSR2, } +#[cfg(windows)] +use std::{fmt, io::Write}; + #[cfg(windows)] impl fmt::Display for Signal { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - use std::io::Write; - use Self::*; - write!( + write!("{}", f, match self { - SIGKILL => "SIGKILL", - SIGTERM => "SIGTERM", - SIGINT => "SIGINT", - SIGHUP => "SIGHUP", - SIGSTOP => "SIGSTOP", - SIGCONT => "SIGCONT", - SIGCHLD => "SIGCHLD", - SIGUSR1 => "SIGUSR1", - SIGUSR2 => "SIGUSR2", + Self::SIGKILL => "SIGKILL", + Self::SIGTERM => "SIGTERM", + Self::SIGINT => "SIGINT", + Self::SIGHUP => "SIGHUP", + Self::SIGSTOP => "SIGSTOP", + Self::SIGCONT => "SIGCONT", + Self::SIGCHLD => "SIGCHLD", + Self::SIGUSR1 => "SIGUSR1", + Self::SIGUSR2 => "SIGUSR2", } ) }