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

View file

@ -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",
}
)
}