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

StreamExt: add chunks and try_chunks #97

Closed
wants to merge 3 commits into from

Conversation

SaltyKitkat
Copy link

@SaltyKitkat SaltyKitkat commented Mar 23, 2024

I love this crate a lot because of its wonderful api and elegant implement. I really need chunks and try_chunks method for StreamExt, which is missing in this crate. So I forked this repo, and added them. And I wonder if this could be merged.

The codes are mainly from futures-rs with some changes:

  1. Remove Sink and FusedStream related things
  2. Remove references to TryStream
  3. Rename type parameter St to S
  4. fix size_hints as mentioned here
  5. rewrite some inline docs to fit futures-lite and changes above

Thanks a lot for your reviewing this :)

@SaltyKitkat
Copy link
Author

SaltyKitkat commented Mar 23, 2024

usize::div_ceil is stable since 1.73, while rustc in CI/msrv is 1.60 :(

@SaltyKitkat SaltyKitkat force-pushed the master branch 3 times, most recently from 9325e50 to 0fb227e Compare March 23, 2024 15:00
@notgull
Copy link
Member

notgull commented Mar 23, 2024

I don't think this is the right API to expose in futures-lite, as it seems somewhat opinionated and allocation-heavy. Maybe an array_chunks-type API would be better, but that probably can't be done safely at the current MSRV.

So I don't think we should have this API. Thanks anyways!

@notgull notgull closed this Mar 23, 2024
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.

None yet

2 participants