summaryrefslogtreecommitdiffstats
path: root/tokio-test
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-11-06 23:53:46 -0800
committerGitHub <noreply@github.com>2019-11-06 23:53:46 -0800
commit7e35922a1d282b1e3dadf037cd237be336b331fb (patch)
treee82a816ee44f6c333a32f263940e80a1c1680943 /tokio-test
parent4dbe6af0a1a1c8e579b92ec8ffc1d419244e0944 (diff)
time: rename `tokio::timer` -> `tokio::time` (#1745)
Diffstat (limited to 'tokio-test')
-rw-r--r--tokio-test/src/clock.rs13
-rw-r--r--tokio-test/src/io.rs2
-rw-r--r--tokio-test/tests/block_on.rs2
-rw-r--r--tokio-test/tests/clock.rs2
4 files changed, 9 insertions, 10 deletions
diff --git a/tokio-test/src/clock.rs b/tokio-test/src/clock.rs
index 38417539..d2f29249 100644
--- a/tokio-test/src/clock.rs
+++ b/tokio-test/src/clock.rs
@@ -1,10 +1,9 @@
-//! A mocked clock for use with `tokio::timer` based futures.
+//! A mocked clock for use with `tokio::time` based futures.
//!
//! # Example
//!
//! ```
-//! use tokio::clock;
-//! use tokio::timer::delay;
+//! use tokio::time::{clock, delay};
//! use tokio_test::{assert_ready, assert_pending, task};
//!
//! use std::time::Duration;
@@ -23,8 +22,8 @@
//! ```
use tokio::runtime::{Park, Unpark};
-use tokio::timer::clock::{Clock, Now};
-use tokio::timer::Timer;
+use tokio::time::clock::{Clock, Now};
+use tokio::time::Timer;
use std::marker::PhantomData;
use std::rc::Rc;
@@ -125,13 +124,13 @@ impl MockClock {
where
F: FnOnce(&mut Handle) -> R,
{
- tokio::timer::clock::with_default(&self.clock, || {
+ tokio::time::clock::with_default(&self.clock, || {
let park = self.time.mock_park();
let timer = Timer::new(park);
let handle = timer.handle();
let time = self.time.clone();
- let _timer = tokio::timer::set_default(&handle);
+ let _timer = tokio::time::set_default(&handle);
let mut handle = Handle::new(timer, time);
f(&mut handle)
// lazy(|| Ok::<_, ()>(f(&mut handle))).wait().unwrap()
diff --git a/tokio-test/src/io.rs b/tokio-test/src/io.rs
index afd1c423..a073193c 100644
--- a/tokio-test/src/io.rs
+++ b/tokio-test/src/io.rs
@@ -18,7 +18,7 @@
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::sync::mpsc;
-use tokio::timer::{clock, timer, Delay};
+use tokio::time::{clock, timer, Delay};
use bytes::Buf;
use futures_core::ready;
diff --git a/tokio-test/tests/block_on.rs b/tokio-test/tests/block_on.rs
index 6d5f481a..c361d500 100644
--- a/tokio-test/tests/block_on.rs
+++ b/tokio-test/tests/block_on.rs
@@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)]
-use tokio::timer::delay;
+use tokio::time::delay;
use tokio_test::block_on;
use std::time::{Duration, Instant};
diff --git a/tokio-test/tests/clock.rs b/tokio-test/tests/clock.rs
index abb61e23..d9d2fcfc 100644
--- a/tokio-test/tests/clock.rs
+++ b/tokio-test/tests/clock.rs
@@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)]
-use tokio::timer::delay;
+use tokio::time::delay;
use tokio_test::clock::MockClock;
use tokio_test::task;
use tokio_test::{assert_pending, assert_ready};