mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
time: rename tokio::timer -> tokio::time (#1745)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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(()));
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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,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,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};
|
||||
|
||||
|
||||
@@ -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,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,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,
|
||||
|
||||
Reference in New Issue
Block a user