diff options
author | Jakub Beránek <berykubik@gmail.com> | 2019-08-20 17:39:55 +0200 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2019-08-20 08:39:55 -0700 |
commit | 2d56312b89ba407272b161290d563551efc896a6 (patch) | |
tree | 5906575cc0e25535a74e287a685beb64f669fff2 /tokio-test/src | |
parent | 357df38861ec61547b5b1d90f0007c11d53fb9ec (diff) |
timer: introduce delay function shortcut (#1440)
This commit adds a simple delay shortcut to avoid writing Delay::new
everywhere and removes usages of Delay::new.
Diffstat (limited to 'tokio-test/src')
-rw-r--r-- | tokio-test/src/clock.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tokio-test/src/clock.rs b/tokio-test/src/clock.rs index 43f073d9..a5c8b4f2 100644 --- a/tokio-test/src/clock.rs +++ b/tokio-test/src/clock.rs @@ -7,14 +7,13 @@ //! //! use tokio::clock; //! use tokio_test::{assert_ready, assert_pending, task}; -//! use tokio_timer::Delay; +//! use tokio_timer::delay; //! //! use std::time::Duration; //! //! tokio_test::clock::mock(|handle| { //! let mut task = task::spawn(async { -//! let delay = Delay::new(clock::now() + Duration::from_secs(1)); -//! delay.await +//! delay(clock::now() + Duration::from_secs(1)).await //! }); //! //! assert_pending!(task.poll()); |