{{ message }}
Add methods to collect Zip into an array#797
Merged
Merged
Conversation
bluss
commented
Apr 13, 2020
Member
Author
Member
Author
|
Now using MaybeUninit, because |
0b78e28 to
52d5286
Compare
Use MaybeUninit to handle uninitialized data safely.
Use Array::maybe_uniit to not need to zero result elements; Restrict to Copy, because we don't implement correct drop on panic yet.
52d5286 to
313f9a3
Compare
313f9a3 to
3ed3525
Compare
Member
Author
(This is just a remainder from before pub(crate) was a feature we could use)
3ed3525 to
f7319b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add
Add internal (for now) constructors for
MaybeUninit<T>-filled arrays.Restrict to Copy elements to use collect (because we don't implement dropping a
halfway filled array yet).
This is added to all but the last arity of Zip (because the last item is needed for the result that we collect into.
The assignment functions are generalized so that we can assign to
&mut T,&mut MaybeUninit<T>and&Cell<T>when we have elements ofT. This seems powerful, and could be a concept that's explored further (methods .assign() and .fill() come to mind).A very minor question is what to name and in which module to put the new trait for this -
AssignElem<T>.Fixes #755