From 4c0743af69f0631f7cac38b13b9ee5858a15e806 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Fri, 8 Mar 2024 18:02:27 +0000 Subject: [PATCH] Add documentation note for designed usecase --- futures-util/src/future/always_ready.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/futures-util/src/future/always_ready.rs b/futures-util/src/future/always_ready.rs index 2d28619fe..0acd3b767 100644 --- a/futures-util/src/future/always_ready.rs +++ b/futures-util/src/future/always_ready.rs @@ -40,6 +40,9 @@ impl T> Future for AlwaysReady { /// 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>`], +/// as [`AlwaysReady`] does not have to store a boolean for `is_finished`. +/// /// # Examples /// /// ```