heapless icon indicating copy to clipboard operation
heapless copied to clipboard

Add Vec::from_array_unchecked

Open Bajix opened this issue 2 years ago • 2 comments

I'm working on a new version of swap_queue that integrates with heapless::Vec, but for my use case I want to be able to construct this by passing ownership of a buffer [MaybeUninit<T>; M] so that there's no cloning. Please add this behavior and feel free to make any changes per your discretion

Bajix avatar Jun 05 '22 00:06 Bajix

Hi, thanks for the PR! Could you add a test for this and an SAFETY comment on how to use this method safely? And also please check the failing tests.

korken89 avatar Jun 07 '22 09:06 korken89

Are you sure that this does not cause a stack-on-stack memcpy?

vrmiguel avatar Jan 31 '23 04:01 vrmiguel