heapless icon indicating copy to clipboard operation
heapless copied to clipboard

Feature request create a vec macro

Open seanybaggins opened this issue 2 years ago • 1 comments

I was wondering if you could make a vec macro that is similar to the one in the standard lib.

seanybaggins avatar Feb 15 '23 20:02 seanybaggins

If you're looking to make vector initialization from arrays a one-liner and avoid extra copies, one soluton could be if we implement From<[T; M]> for Vec<T, N> where N >= M.

let v: Vec<u8, 8> = [0, 1, 2, 3].into(); // capacity=8, length=4

rjsberry avatar Feb 27 '23 19:02 rjsberry