summaryrefslogtreecommitdiffstats
path: root/tokio-util/src/context.rs
diff options
context:
space:
mode:
authorJuan Alvarez <j@yabit.io>2020-10-01 02:24:33 -0500
committerGitHub <noreply@github.com>2020-10-01 09:24:33 +0200
commit53ccfc1fd694ee70c7a4d1e7af09a856bafb49e5 (patch)
tree66f0b4c089729616b57bbb69b0a6351b45a0c898 /tokio-util/src/context.rs
parent971ed2c6df9cb3bf3543a9c780662a0b4d1a8d40 (diff)
time: introduce `sleep` and `sleep_until` functions (#2826)
Diffstat (limited to 'tokio-util/src/context.rs')
-rw-r--r--tokio-util/src/context.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tokio-util/src/context.rs b/tokio-util/src/context.rs
index e07538d9..5f6c6b9b 100644
--- a/tokio-util/src/context.rs
+++ b/tokio-util/src/context.rs
@@ -46,7 +46,7 @@ pub trait RuntimeExt {
///
/// ```no_run
/// use tokio_util::context::RuntimeExt;
- /// use tokio::time::{delay_for, Duration};
+ /// use tokio::time::{sleep, Duration};
///
/// let rt = tokio::runtime::Builder::new()
/// .threaded_scheduler()
@@ -57,11 +57,11 @@ pub trait RuntimeExt {
/// .threaded_scheduler()
/// .build().unwrap();
///
- /// let fut = delay_for(Duration::from_millis(2));
+ /// let fut = sleep(Duration::from_millis(2));
///
/// rt.block_on(
/// rt2
- /// .wrap(async { delay_for(Duration::from_millis(2)).await }),
+ /// .wrap(async { sleep(Duration::from_millis(2)).await }),
/// );
///```
fn wrap<F: Future>(&self, fut: F) -> TokioContext<'_, F>;