Skip to content

try_unfold: Fix function docs wording - #2972

Open
matthiasbeyer wants to merge 1 commit into
rust-lang:mainfrom
matthiasbeyer:try-unfold-fix-docs
Open

try_unfold: Fix function docs wording#2972
matthiasbeyer wants to merge 1 commit into
rust-lang:mainfrom
matthiasbeyer:try-unfold-fix-docs

Conversation

@matthiasbeyer

Copy link
Copy Markdown

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.

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 <mail@beyermatthias.de>
@rustbot rustbot added A-stream Area: futures::stream S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2025
@matthiasbeyer

matthiasbeyer commented Oct 11, 2025

Copy link
Copy Markdown
Author

cargo doc workflow failure seems to be unrelated.


It might be debatable whether the docs should mention the wrapping Result<_, _> from the TryFuture.
I'm of course open to that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-stream Area: futures::stream S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants