summaryrefslogtreecommitdiffstats
path: root/tokio-signal/examples/sighup-example.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio-signal/examples/sighup-example.rs')
-rw-r--r--tokio-signal/examples/sighup-example.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/tokio-signal/examples/sighup-example.rs b/tokio-signal/examples/sighup-example.rs
index 5edb7862..98346912 100644
--- a/tokio-signal/examples/sighup-example.rs
+++ b/tokio-signal/examples/sighup-example.rs
@@ -1,6 +1,4 @@
-extern crate futures;
-extern crate tokio;
-extern crate tokio_signal;
+#![deny(warnings, rust_2018_idioms)]
// A trick to not fail build on non-unix platforms when using unix-specific features.
#[cfg(unix)]
@@ -9,7 +7,7 @@ mod platform {
use futures::{Future, Stream};
use tokio_signal::unix::{Signal, SIGHUP};
- pub fn main() -> Result<(), Box<::std::error::Error>> {
+ pub fn main() -> Result<(), Box<dyn (::std::error::Error)>> {
// on Unix, we can listen to whatever signal we want, in this case: SIGHUP
let stream = Signal::new(SIGHUP).flatten_stream();
@@ -43,11 +41,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()
}