Skip to content

Commit 0a42259

Browse files
authored
doc: add sleep alias to delay_for (#2589)
1 parent d223019 commit 0a42259

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tokio/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
1717
))]
1818
#![cfg_attr(docsrs, feature(doc_cfg))]
19+
#![cfg_attr(docsrs, feature(doc_alias))]
1920

2021
//! A runtime for writing reliable, asynchronous, and slim applications.
2122
//!

tokio/src/time/delay.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub fn delay_until(deadline: Instant) -> Delay {
3333
///
3434
/// Canceling a delay is done by dropping the returned future. No additional
3535
/// cleanup work is required.
36+
#[cfg_attr(docsrs, doc(alias = "sleep"))]
3637
pub fn delay_for(duration: Duration) -> Delay {
3738
delay_until(Instant::now() + duration)
3839
}

0 commit comments

Comments
 (0)