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 -4
View File
@@ -7,8 +7,9 @@ name = "tokio-test"
# - Cargo.toml
# - README.md
# - Update CHANGELOG.md.
# - Create "v0.1.x" git tag.
version = "0.1.0"
# - Create "v0.2.x" git tag.
version = "0.2.0"
edition = "2018"
authors = ["Tokio Contributors <[email protected]>"]
license = "MIT"
repository = "https://github.com/tokio-rs/tokio"
@@ -22,5 +23,5 @@ publish = false
[dependencies]
futures = "0.1"
tokio-timer = "0.2"
tokio-executor = "0.1"
tokio-timer = { version = "0.3.0", path = "../tokio-timer" }
tokio-executor = { version = "0.2.0", path = "../tokio-executor" }
-1
View File
@@ -17,7 +17,6 @@ Next, add this to your crate:
```rust
#[macro_use]
extern crate tokio_test;
```
You can find extensive documentation and examples about how to use this crate
+6 -7
View File
@@ -3,13 +3,12 @@
//! # Example
//!
//! ```
//! # #[macro_use] extern crate tokio_test;
//! # extern crate futures;
//! # extern crate tokio_timer;
//! # use tokio_test::clock;
//! # use tokio_timer::Delay;
//! # use std::time::Duration;
//! # use futures::Future;
//! use tokio_test::clock;
//! use tokio_test::{assert_ready, assert_not_ready};
//! use tokio_timer::Delay;
//! use std::time::Duration;
//! use futures::Future;
//!
//! clock::mock(|handle| {
//! let mut delay = Delay::new(handle.now() + Duration::from_secs(1));
//!
+9 -7
View File
@@ -1,23 +1,25 @@
#![doc(html_root_url = "https://docs.rs/tokio-test/0.1.0")]
#![deny(missing_docs, missing_debug_implementations, unreachable_pub)]
#![deny(
missing_docs,
missing_debug_implementations,
unreachable_pub,
rust_2018_idioms
)]
#![cfg_attr(test, deny(warnings))]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
//! Tokio and Futures based testing utilites
//!
//! # Example
//!
//! ```
//! # extern crate futures;
//! # #[macro_use] extern crate tokio_test;
//! # use futures::{Future, future};
//! use tokio_test::assert_ready;
//!
//! let mut fut = future::ok::<(), ()>(());
//! assert_ready!(fut.poll());
//! ```
extern crate futures;
extern crate tokio_executor;
extern crate tokio_timer;
pub mod clock;
mod macros;
pub mod task;
+1 -3
View File
@@ -6,8 +6,7 @@
//! poll.
//!
//! ```
//! # #[macro_use] extern crate tokio_test;
//! # extern crate futures;
//! # use tokio_test::assert_ready_eq;
//! # use tokio_test::task::MockTask;
//! # use futures::{sync::mpsc, Stream, Sink, Future, Async};
//! let mut task = MockTask::new();
@@ -20,7 +19,6 @@
use futures::executor::{spawn, Notify};
use futures::{future, Async};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Condvar, Mutex};
+2 -4
View File
@@ -1,12 +1,10 @@
#[macro_use]
extern crate tokio_test;
extern crate futures;
extern crate tokio_timer;
#![deny(warnings, rust_2018_idioms)]
use futures::Future;
use std::time::{Duration, Instant};
use tokio_test::clock::MockClock;
use tokio_test::task::MockTask;
use tokio_test::{assert_not_ready, assert_ready};
use tokio_timer::Delay;
#[test]