From 051878da9be7d61133ad07662b4c71355c0b5932 Mon Sep 17 00:00:00 2001 From: Milo <50248166+Milo123459@users.noreply.github.com> Date: Mon, 28 Jun 2021 07:25:38 +0100 Subject: [PATCH 1/2] Alias sleep to wait in docs --- tokio/src/time/driver/sleep.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tokio/src/time/driver/sleep.rs b/tokio/src/time/driver/sleep.rs index 8658813896e..69c541b8153 100644 --- a/tokio/src/time/driver/sleep.rs +++ b/tokio/src/time/driver/sleep.rs @@ -57,6 +57,7 @@ pub fn sleep_until(deadline: Instant) -> Sleep { /// [`interval`]: crate::time::interval() // Alias for old name in 0.x #[cfg_attr(docsrs, doc(alias = "delay_for"))] +#[doc(alias = "wait")] pub fn sleep(duration: Duration) -> Sleep { match Instant::now().checked_add(duration) { Some(deadline) => sleep_until(deadline), From 3c8c8a3251380c51828170b9d333113c4e109fd5 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Mon, 28 Jun 2021 09:54:24 +0200 Subject: [PATCH 2/2] Use cfg_attr --- tokio/src/time/driver/sleep.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/time/driver/sleep.rs b/tokio/src/time/driver/sleep.rs index 69c541b8153..40f745ad7e8 100644 --- a/tokio/src/time/driver/sleep.rs +++ b/tokio/src/time/driver/sleep.rs @@ -57,7 +57,7 @@ pub fn sleep_until(deadline: Instant) -> Sleep { /// [`interval`]: crate::time::interval() // Alias for old name in 0.x #[cfg_attr(docsrs, doc(alias = "delay_for"))] -#[doc(alias = "wait")] +#[cfg_attr(docsrs, doc(alias = "wait"))] pub fn sleep(duration: Duration) -> Sleep { match Instant::now().checked_add(duration) { Some(deadline) => sleep_until(deadline),