time: rename tokio::timer -> tokio::time (#1745)

This commit is contained in:
Carl Lerche
2019-11-06 23:53:46 -08:00
committed by GitHub
parent 4dbe6af0a1
commit 7e35922a1d
42 changed files with 101 additions and 124 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
#![warn(rust_2018_idioms)]
use tokio::runtime;
use tokio::timer::clock::Clock;
use tokio::timer::*;
use tokio::time::clock::Clock;
use tokio::time::*;
use std::sync::mpsc;
use std::time::{Duration, Instant};
struct MockNow(Instant);
impl tokio::timer::clock::Now for MockNow {
impl tokio::time::clock::Now for MockNow {
fn now(&self) -> Instant {
self.0
}
+3 -3
View File
@@ -38,7 +38,7 @@ rt_test! {
use tokio::prelude::*;
use tokio::runtime::Runtime;
use tokio::sync::oneshot;
use tokio::timer;
use tokio::time;
use tokio_test::{assert_err, assert_ok};
use futures_util::future::poll_fn;
@@ -289,7 +289,7 @@ rt_test! {
let dur = Duration::from_millis(50);
rt.block_on(async move {
timer::delay_for(dur).await;
time::delay_for(dur).await;
});
assert!(now.elapsed() >= dur);
@@ -306,7 +306,7 @@ rt_test! {
let (tx, rx) = oneshot::channel();
tokio::spawn(async move {
timer::delay_for(dur).await;
time::delay_for(dur).await;
assert_ok!(tx.send(()));
});
+2 -2
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
use tokio::timer::clock;
use tokio::timer::clock::*;
use tokio::time::clock;
use tokio::time::clock::*;
use std::time::Instant;
+2 -2
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
use tokio::timer::delay;
use tokio::timer::timer::Handle;
use tokio::time::delay;
use tokio::time::timer::Handle;
use tokio_test::task;
use tokio_test::{assert_pending, assert_ready, clock};
+1 -1
View File
@@ -3,7 +3,7 @@
use tokio::executor::park::{Park, Unpark, UnparkThread};
use tokio::runtime;
use tokio::timer::{Delay, Timer};
use tokio::time::{Delay, Timer};
use rand::Rng;
use std::cmp;
+1 -1
View File
@@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)]
use tokio::timer::*;
use tokio::time::*;
use tokio_test::task;
use tokio_test::{assert_pending, assert_ready_eq, clock};
+1 -1
View File
@@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)]
use tokio::timer::*;
use tokio::time::*;
use tokio_test::{assert_ok, assert_pending, assert_ready};
use tokio_test::{clock, task};
+2 -2
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
use tokio::prelude::*;
use tokio::timer::*;
use tokio::time::*;
use std::sync::mpsc;
use std::time::{Duration, Instant};
@@ -35,7 +35,7 @@ fn timer_with_current_thread_runtime() {
rt.block_on(async move {
let when = Instant::now() + Duration::from_millis(100);
tokio::timer::delay(when).await;
tokio::time::delay(when).await;
assert!(Instant::now() >= when);
tx.send(()).unwrap();
+1 -1
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
use tokio::sync::mpsc;
use tokio::timer::throttle::Throttle;
use tokio::time::throttle::Throttle;
use tokio_test::task;
use tokio_test::{assert_pending, assert_ready_eq, clock};
+1 -1
View File
@@ -1,7 +1,7 @@
#![warn(rust_2018_idioms)]
use tokio::sync::oneshot;
use tokio::timer::*;
use tokio::time::*;
use tokio_test::task;
use tokio_test::{
assert_err, assert_pending, assert_ready, assert_ready_err, assert_ready_ok, clock,