]> git.lizzy.rs Git - rust.git/commitdiff
Cleanup FIXMEs (#3488)
authorSeo Sanghyeon <sanxiyn@gmail.com>
Thu, 31 Jan 2013 10:23:18 +0000 (19:23 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Thu, 31 Jan 2013 10:23:18 +0000 (19:23 +0900)
src/libcore/vec.rs

index f516ed366de73939cb38a5180bf6c57fd433cd53..ef7a07ca131f1a3ac8de2ea52840590dca062c11 100644 (file)
@@ -541,10 +541,8 @@ pub fn remove<T>(v: &mut ~[T], i: uint) -> T {
     v.pop()
 }
 
-pub fn consume<T>(v: ~[T], f: fn(uint, v: T)) {
+pub fn consume<T>(mut v: ~[T], f: fn(uint, v: T)) {
     unsafe {
-        let mut v = v; // FIXME(#3488)
-
         do as_mut_buf(v) |p, ln| {
             for uint::range(0, ln) |i| {
                 // NB: This unsafe operation counts on init writing 0s to the
@@ -641,8 +639,7 @@ pub fn push_all<T: Copy>(v: &mut ~[T], rhs: &[const T]) {
 }
 
 #[inline(always)]
-pub fn push_all_move<T>(v: &mut ~[T], rhs: ~[T]) {
-    let mut rhs = rhs; // FIXME(#3488)
+pub fn push_all_move<T>(v: &mut ~[T], mut rhs: ~[T]) {
     reserve(&mut *v, v.len() + rhs.len());
     unsafe {
         do as_mut_buf(rhs) |p, len| {
@@ -1241,8 +1238,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  * Returns a vector of tuples, where the i-th tuple contains contains the
  * i-th elements from each of the input vectors.
  */
-pub pure fn zip<T, U>(v: ~[T], u: ~[U]) -> ~[(T, U)] {
-    let mut v = v, u = u; // FIXME(#3488)
+pub pure fn zip<T, U>(mut v: ~[T], mut u: ~[U]) -> ~[(T, U)] {
     let mut i = len(v);
     assert i == len(u);
     let mut w = with_capacity(i);