Moar windows fixes

This commit is contained in:
Félix Saparelli 2021-04-11 04:50:31 +12:00
parent 15806019af
commit d37261529c
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 13 additions and 12 deletions

View File

@ -28,23 +28,24 @@ pub enum Signal {
SIGUSR2, SIGUSR2,
} }
#[cfg(windows)]
use std::{fmt, io::Write};
#[cfg(windows)] #[cfg(windows)]
impl fmt::Display for Signal { impl fmt::Display for Signal {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use std::io::Write; write!("{}",
use Self::*;
write!(
f, f,
match self { match self {
SIGKILL => "SIGKILL", Self::SIGKILL => "SIGKILL",
SIGTERM => "SIGTERM", Self::SIGTERM => "SIGTERM",
SIGINT => "SIGINT", Self::SIGINT => "SIGINT",
SIGHUP => "SIGHUP", Self::SIGHUP => "SIGHUP",
SIGSTOP => "SIGSTOP", Self::SIGSTOP => "SIGSTOP",
SIGCONT => "SIGCONT", Self::SIGCONT => "SIGCONT",
SIGCHLD => "SIGCHLD", Self::SIGCHLD => "SIGCHLD",
SIGUSR1 => "SIGUSR1", Self::SIGUSR1 => "SIGUSR1",
SIGUSR2 => "SIGUSR2", Self::SIGUSR2 => "SIGUSR2",
} }
) )
} }