diff options
Diffstat (limited to 'tokio-signal/examples/multiple.rs')
-rw-r--r-- | tokio-signal/examples/multiple.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tokio-signal/examples/multiple.rs b/tokio-signal/examples/multiple.rs index fa8f1be2..c0443ce7 100644 --- a/tokio-signal/examples/multiple.rs +++ b/tokio-signal/examples/multiple.rs @@ -1,8 +1,6 @@ -//! A small example of how to listen for two signals at the same time +#![deny(warnings, rust_2018_idioms)] -extern crate futures; -extern crate tokio; -extern crate tokio_signal; +//! A small example of how to listen for two signals at the same time // A trick to not fail build on non-unix platforms when using unix-specific features. #[cfg(unix)] @@ -11,7 +9,7 @@ mod platform { use futures::{Future, Stream}; use tokio_signal::unix::{Signal, SIGINT, SIGTERM}; - pub fn main() -> Result<(), Box<::std::error::Error>> { + pub fn main() -> Result<(), Box<dyn (::std::error::Error)>> { // Create a stream for each of the signals we'd like to handle. let sigint = Signal::new(SIGINT).flatten_stream(); let sigterm = Signal::new(SIGTERM).flatten_stream(); @@ -44,11 +42,11 @@ mod platform { #[cfg(not(unix))] mod platform { - pub fn main() -> Result<(), Box<::std::error::Error>> { + pub fn main() -> Result<(), Box<dyn std::error::Error>> { Ok(()) } } -fn main() -> Result<(), Box<std::error::Error>> { +fn main() -> Result<(), Box<dyn std::error::Error>> { platform::main() } |