diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-07-12 00:53:03 -0700 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-07-12 16:13:51 -0400 |
| commit | 1ec06e01241822f799b3b8da176797593d51bb17 (patch) | |
| tree | 5c7c67e5e4febf12b712e95a0a68bbdb1c658617 /src/libstd | |
| parent | 2b96408600c33b81c3c41f661764aa8d80cf3c9d (diff) | |
| download | rust-1ec06e01241822f799b3b8da176797593d51bb17.tar.gz rust-1ec06e01241822f799b3b8da176797593d51bb17.zip | |
Remove the global 'vec::to_owned' function
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rand.rs | 2 | ||||
| -rw-r--r-- | src/libstd/vec.rs | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/libstd/rand.rs b/src/libstd/rand.rs index 55b6fad21e7..2cf45ba70ec 100644 --- a/src/libstd/rand.rs +++ b/src/libstd/rand.rs @@ -591,7 +591,7 @@ impl<R: Rng> RngUtil for R { /// Shuffle a vec fn shuffle<T:Copy>(&mut self, values: &[T]) -> ~[T] { - let mut m = vec::to_owned(values); + let mut m = values.to_owned(); self.shuffle_mut(m); m } diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 4ab93da8c09..409c1967298 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -91,11 +91,6 @@ pub fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] { } } -/// Creates a new unique vector with the same contents as the slice -pub fn to_owned<T:Copy>(t: &[T]) -> ~[T] { - from_fn(t.len(), |i| copy t[i]) -} - /// Creates a new vector with a capacity of `capacity` #[cfg(stage0)] pub fn with_capacity<T>(capacity: uint) -> ~[T] { |
