signal: Change constructors to return a result instead of lazy future (#1340)

This commit is contained in:
Ivan Petkov
2019-07-30 18:23:26 -07:00
committed by GitHub
parent bf38631d6a
commit ff922bbe6d
18 changed files with 86 additions and 143 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ mod platform {
pub async fn main() {
// Create a stream for each of the signals we'd like to handle.
let sigint = Signal::new(SIGINT).await.unwrap().map(|_| SIGINT);
let sigterm = Signal::new(SIGTERM).await.unwrap().map(|_| SIGTERM);
let sigint = Signal::new(SIGINT).unwrap().map(|_| SIGINT);
let sigterm = Signal::new(SIGTERM).unwrap().map(|_| SIGTERM);
// Use the `select` combinator to merge these two streams into one
let stream = stream::select(sigint, sigterm);