We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Currently core::at_vec has constructor functions including build, build_sized, build_sized_opt, from_fn and from_elem.
core::at_vec
build
build_sized
build_sized_opt
from_fn
from_elem
As far as I understand, none of these allow constructing an @vec by moving (rather than copying) all the values from a ~vec.
Therefore, I think it would be good if core::at_vec gained a function like:
pub fn from_owned<T>(v: ~[T]) -> @[T] { ... }
and, for convenience, something like this too:
pub fn from_slice<T:Copy>(v: &[T]) -> @[T] { ... }
Is this proposal something desirable? If so I will try and submit code/docs/tests.
The text was updated successfully, but these errors were encountered:
Merge pull request #4580 from Dretch/atvec-constructors
519b60f
Add more constructors for managed vectors (as proposed in issue #4553)
I merged @Dretch 's change in 519b60f
Sorry, something went wrong.
No branches or pull requests
Currently
core::at_vec
has constructor functions includingbuild
,build_sized
,build_sized_opt
,from_fn
andfrom_elem
.As far as I understand, none of these allow constructing an @vec by moving (rather than copying) all the values from a ~vec.
Therefore, I think it would be good if
core::at_vec
gained a function like:pub fn from_owned<T>(v: ~[T]) -> @[T] { ... }
and, for convenience, something like this too:
pub fn from_slice<T:Copy>(v: &[T]) -> @[T] { ... }
Is this proposal something desirable? If so I will try and submit code/docs/tests.
The text was updated successfully, but these errors were encountered: