Skip to content

Commit 637b0cc

Browse files
committed
docs: fix clippy lint
1 parent 69c36b1 commit 637b0cc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/util.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub async fn pending<T>() {
66
std::future::pending::<T>().await;
77
}
88

9-
/// A task which sleeps for a specified duration.
9+
/// Sleep for a specified duration.
1010
pub async fn sleep(duration: Duration) {
1111
Delay::new(duration).await;
1212
}
@@ -23,6 +23,10 @@ mod wasm {
2323
use gloo_timers::future::TimeoutFuture;
2424
use web_time::Duration;
2525

26+
/// Execute a future or error on timeout, whichever comes first.
27+
///
28+
/// # Errors
29+
/// Will return `Err` if the timeout occurs before the future is ready.
2630
pub async fn timeout<F, T>(dur: Duration, f: F) -> Result<T, TimeoutError>
2731
where
2832
F: Future<Output = T>,
@@ -45,6 +49,10 @@ mod native {
4549
use futures_timer::Delay;
4650
use web_time::Duration;
4751

52+
/// Execute a future or error on timeout, whichever comes first.
53+
///
54+
/// # Errors
55+
/// Will return `Err` if the timeout occurs before the future is ready.
4856
pub async fn timeout<F, T>(dur: Duration, f: F) -> Result<T, TimeoutError>
4957
where
5058
F: Future<Output = T>,

0 commit comments

Comments
 (0)