-
Notifications
You must be signed in to change notification settings - Fork 341
FromStream impls for collections (and more!) #271
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
Conversation
02127f2
to
a0193fa
Compare
@yoshuawuyts This PR is ready for review/merge! You should merge #266 first. Once that and this PR are merged, you can check off all the impls for I believe we actually cover even more than what's listed in the original tracking issue. I intentionally went off of the |
@sunjay thanks so much for this! -- could you perhaps rebase on master to get the clippy fixes in for CI? Thanks! |
246474c
to
f968c9a
Compare
It's rebased! |
All tests are passing; this is really good!! Let's merge this! bors r+ |
271: FromStream impls for collections (and more!) r=yoshuawuyts a=sunjay Just opening this to have some visibility on my work as I finish it off. Hopefully will be done in the next day or two, but if not, this is here for someone else to finish it off. I'm currently in the process of adding the `FromStream` impls for all the collections. This is generally a very easy and repetitive process: 1. Look up the impl of `FromIterator` for the given collection, it probably uses the `Extend` trait which is also implemented for that collection 2. Copy and paste the directory for the collection that is closest to the collection you're currently doing (closest in terms of the type parameters needed) 3. Update the `Extend` impl to be for the collection you're implementing, being careful to use the `reserve` method if the collection has one to avoid allocating too many times 4. Update the `FromStream` impl to be for the collection you're implementing 5. Make sure you update the docs in the copied `mod.rs` and that you've updated `collections/mod.rs` 6. Test with `--features unstable` or your code will not be compiled The majority of this work is just looking at what `std` does and adapting it to streams. Honestly it's kind of relaxing after a long day... (maybe I'm weird!) 😄 Co-authored-by: Sunjay Varma <[email protected]>
Build succeeded
|
Just opening this to have some visibility on my work as I finish it off. Hopefully will be done in the next day or two, but if not, this is here for someone else to finish it off.
I'm currently in the process of adding the
FromStream
impls for all the collections. This is generally a very easy and repetitive process:FromIterator
for the given collection, it probably uses theExtend
trait which is also implemented for that collectionExtend
impl to be for the collection you're implementing, being careful to use thereserve
method if the collection has one to avoid allocating too many timesFromStream
impl to be for the collection you're implementingmod.rs
and that you've updatedcollections/mod.rs
--features unstable
or your code will not be compiledThe majority of this work is just looking at what
std
does and adapting it to streams. Honestly it's kind of relaxing after a long day... (maybe I'm weird!) 😄