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

[construct|deconstruct] Vec/String [from|to] length + [MaybeUninit<T>; N] #507

Open
Felix-El opened this issue Aug 1, 2024 · 1 comment

Comments

@Felix-El
Copy link

Felix-El commented Aug 1, 2024

These operations, let's call them from_parts / into_parts, I believe would be quite useful to allow the payload to change owners/container types without moving the data.

I don't think into_array<M>() can achieve the same because one has to statically know the exact runtime size.
I thought about permitting M to be up to the capacity N but into_array would then have to pad the unused remaining space, which may be quite inefficient.

What are the chances of such MR to be accepted?

@Dirbaio
Copy link
Member

Dirbaio commented Aug 1, 2024

I believe would be quite useful to allow the payload to change owners/container types without moving the data.

functions taking or returning the full [MaybeUninit<T>; N] will still move the data, I'm not sure if adding these functions will allow any performance improvements.

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

No branches or pull requests

2 participants