From b30415d244ed24c046a4c36ec316c3710ecbdadc Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 2 Sep 2019 13:04:44 +0200 Subject: [PATCH] src/server/state.rs: update to tokio alpha.2 Signed-off-by: Wolfgang Bumiller --- src/server/state.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server/state.rs b/src/server/state.rs index 79b85e41..8236ea6a 100644 --- a/src/server/state.rs +++ b/src/server/state.rs @@ -4,8 +4,7 @@ use std::sync::Mutex; use futures::*; -// FIXME: with the next bump `Signal::new` becomes a freestanding function `signal()` -use tokio_net::signal::unix::{Signal, SignalKind}; +use tokio_net::signal::unix::{signal, SignalKind}; use crate::tools::{self, BroadcastData}; @@ -36,7 +35,7 @@ lazy_static! { pub fn server_state_init() -> Result<(), Error> { - let stream = Signal::new(SignalKind::interrupt())?; + let stream = signal(SignalKind::interrupt())?; let future = stream.for_each(|_| { println!("got shutdown request (SIGINT)"); @@ -50,7 +49,7 @@ pub fn server_state_init() -> Result<(), Error> { tokio::spawn(task.map(|_| ())); - let stream = Signal::new(SignalKind::hangup())?; + let stream = signal(SignalKind::hangup())?; let future = stream.for_each(|_| { println!("got reload request (SIGHUP)");