Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stream::from_fn #123

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

feat: add stream::from_fn #123

wants to merge 7 commits into from

Conversation

nanoqsh
Copy link
Contributor

@nanoqsh nanoqsh commented Feb 3, 2025

This adds an analogue of std::iter::from_fn for streams.

Also creates a new feature async-closure that allows to use newer compiler version 1.85 or later to use async closures. Crates for older versions may use this function without the feature but it'll be more limited.

@taiki-e
Copy link
Collaborator

taiki-e commented Feb 5, 2025

Thanks for the PR. This feature is currently not tested in CI, so could you add cargo test --all-features to the following?

- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features alloc

@nanoqsh
Copy link
Contributor Author

nanoqsh commented Feb 5, 2025

Thanks for the PR. This feature is currently not tested in CI, so could you add cargo test --all-features to the following?

- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features alloc

Initially I added ignore to the example with async closure to be able to generate documentation and run tests on Rust earlier than 1.85. The syntax of async closure prevents its use from being hidden behind cfg(feature = "async-closure") attribute, it still won't compile.

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

Successfully merging this pull request may close these issues.

2 participants