diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index c56fe73c..d2dd13c0 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -53,6 +53,7 @@ pub mod net { pub use tokio::net::{UnixDatagram, UnixListener, UnixStream}; } + #[cfg(unix)] pub use self::unix::*; } diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index 6703d813..c001e237 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -11,12 +11,15 @@ use crate::server::Server; #[derive(PartialEq, Clone, Copy, Debug)] pub(crate) enum Signal { /// SIGHUP + #[cfg_attr(not(unix), allow(dead_code))] Hup, /// SIGINT Int, /// SIGTERM + #[cfg_attr(not(unix), allow(dead_code))] Term, /// SIGQUIT + #[cfg_attr(not(unix), allow(dead_code))] Quit, } @@ -69,7 +72,7 @@ impl Future for Signals { #[cfg(not(unix))] loop { match Pin::new(&mut self.stream).poll_next(cx) { - Poll::Ready(Ok(Some(_))) => self.srv.signal(Signal::Int), + Poll::Ready(Some(_)) => self.srv.signal(Signal::Int), Poll::Ready(None) => return Poll::Ready(()), Poll::Pending => return Poll::Pending, }