Last active
April 4, 2018 18:14
-
-
Save tobz/0d8461ebbab916f7792cd04b6473a3c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0271]: type mismatch resolving `<futures::Map<futures::Receiver<()>, [closure@src/main.rs:118:18: 121:14]> as futures::Future>::Error == ()` | |
--> src/main.rs:122:9 | |
| | |
122 | tokio::spawn(signal_handler); | |
| ^^^^^^^^^^^^ expected struct `futures::Canceled`, found () | |
| | |
= note: expected type `futures::Canceled` | |
found type `()` | |
= note: required by `tokio::spawn` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn run(signal_rx: oneshot::Receiver::<()>) -> Result<()> { | |
tokio::run(future::lazy(|| { | |
// sit on signal_rx until the sender triggers us, but also log when that happens | |
let signal_handler = signal_rx | |
.map(|sig| { | |
info!("we should be closing"); | |
() | |
}); | |
tokio::spawn(signal_handler); | |
Ok(()) | |
})); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment