mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +02:00
Update Tokio to Rust 2018 (#1082)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
extern crate futures;
|
||||
extern crate tokio;
|
||||
extern crate tokio_signal;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
use tokio;
|
||||
use tokio_signal;
|
||||
|
||||
use futures::{Future, Stream};
|
||||
|
||||
/// how many signals to handle before exiting
|
||||
const STOP_AFTER: u64 = 10;
|
||||
|
||||
fn main() -> Result<(), Box<std::error::Error>> {
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// tokio_signal provides a convenience builder for Ctrl+C
|
||||
// this even works cross-platform: linux and windows!
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user