From b8b973e54033df49e576df0ad0f0d14945f80ed2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 11 Oct 2025 13:09:27 +0200 Subject: [PATCH] try_unfold: Fix function docs wording The wording of the documentation of the `try_unfold()` function was a bit misleading. The function signature clearly states that the closure that must be provided to the function must return a `TryFuture` that yields an `Option<(Item, T)>`. The wording of the related documentation indicated that the closure may return `None` or `Some(TryFuture)`, which is wrong. This patch fixes that wording. Signed-off-by: Matthias Beyer --- futures-util/src/stream/try_stream/try_unfold.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/futures-util/src/stream/try_stream/try_unfold.rs b/futures-util/src/stream/try_stream/try_unfold.rs index fd9cdf1d8c..67f4a0677b 100644 --- a/futures-util/src/stream/try_stream/try_unfold.rs +++ b/futures-util/src/stream/try_stream/try_unfold.rs @@ -17,7 +17,7 @@ use pin_project_lite::pin_project; /// wait for the returned `TryFuture` to complete with `(a, b)`. It will then /// yield the value `a`, and use `b` as the next internal state. /// -/// If the closure returns `None` instead of `Some(TryFuture)`, then the +/// If the `TryFuture` returns `None` instead of `Some((Item, T))`, then the /// `try_unfold()` will stop producing items and return `Poll::Ready(None)` in /// future calls to `poll()`. ///