Skip to content

Commit

Permalink
Add documentation note for designed usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Mar 8, 2024
1 parent 9e25781 commit 80c51c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions futures-util/src/future/always_ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ impl<T, F: Fn() -> T> Future for AlwaysReady<T, F> {

/// Creates a future that is always immediately ready with a value.
///
/// This is particularly useful in avoiding a heap allocation when an API needs [`Box<dyn Future<Output = T>>`],
/// as [`AlwaysReady`] does not have to store a boolean for `is_finished`.
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit 80c51c1

Please sign in to comment.