Update Tokio to Rust 2018 (#1082)

This commit is contained in:
Carl Lerche
2019-05-14 10:27:36 -07:00
committed by GitHub
parent 79d8820050
commit cb4aea394e
343 changed files with 1725 additions and 2813 deletions
+5 -7
View File
@@ -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()
}