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

Feature request create a vec macro #344

Open
seanybaggins opened this issue Feb 15, 2023 · 1 comment · May be fixed by #438
Open

Feature request create a vec macro #344

seanybaggins opened this issue Feb 15, 2023 · 1 comment · May be fixed by #438

Comments

@seanybaggins
Copy link

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

@rjsberry
Copy link
Contributor

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

@YuhanLiin YuhanLiin linked a pull request Jan 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants