doc: add sleep alias to delay_for (#2589)

This commit is contained in:
Alice Ryhl 2020-06-10 23:30:08 +02:00 committed by GitHub
parent d22301967b
commit 0a422593f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_alias))]
//! A runtime for writing reliable, asynchronous, and slim applications.
//!

View File

@ -33,6 +33,7 @@ pub fn delay_until(deadline: Instant) -> Delay {
///
/// Canceling a delay is done by dropping the returned future. No additional
/// cleanup work is required.
#[cfg_attr(docsrs, doc(alias = "sleep"))]
pub fn delay_for(duration: Duration) -> Delay {
delay_until(Instant::now() + duration)
}