-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add helper functions for Array<MaybeUninit<T>, U>
#8
Conversation
Adds the following functions: - `uninit`: construct an uninitialized `Array<MaybeUninit<T>, U>` - `assume_init`: converts to `Array<T, U>` assuming all elements are initialized
6738323
to
1582c18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be safe I think we should ask on IRLO about the uninit
method, but AFAIK the code should be fine. It's worth to expand the safety comment and explicitly note that we "assume init" an array of MaybeUninit
s.
Expanding the safety comment sounds good. I can also add a link to the similarly-shaped |
This makes the bounds more complicated but makes it much clearer what's happening, as before it was relying on an implicit definition of `ArraySize::ArrayType`.
@newpavlov d7f32a4 should make it much more explicit what's happening (at the cost of slightly more complicated bounds), and also clears the clippy warning |
Seems at little closer to
|
Adds the following functions:
uninit
: construct an uninitializedArray<MaybeUninit<T>, U>
assume_init
: converts toArray<T, U>
assuming all elements are initialized