Closed
Description
Currently core::at_vec
has constructor functions including build
, build_sized
, build_sized_opt
, from_fn
and 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.
Metadata
Metadata
Assignees
Labels
No labels