Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
matthiasbeyer committed Oct 11, 2025
commit b8b973e54033df49e576df0ad0f0d14945f80ed2
2 changes: 1 addition & 1 deletion futures-util/src/stream/try_stream/try_unfold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
///
Expand Down
Loading