about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2013-05-16 22:03:58 -0400
committerCorey Richardson <corey@octayn.net>2013-05-16 22:05:05 -0400
commitc67a85ada1c949005d030e5cf916aa01c8984f5f (patch)
tree1864a8f3feef71fd33d92e11ba8dc1f568985349
parentc99d1de85bcc7fff69b6ad4f3159fef8707d304b (diff)
downloadrust-c67a85ada1c949005d030e5cf916aa01c8984f5f.tar.gz
rust-c67a85ada1c949005d030e5cf916aa01c8984f5f.zip
Remove each_permutation_ref
-rw-r--r--src/libcore/vec.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 4ad8ff05191..0822fe11f0d 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -1825,26 +1825,6 @@ pub fn each_permutation<T:Copy>(values: &[T], fun: &fn(perm : &[T]) -> bool) {
 }
 
 /**
- * Iterate over all permutations of vector `values`.
- *
- * This is an alternative to each_permutation that uses references to
- * avoid copying the elements of the values vector.
- *
- * To avoid copying, the iterator will be passed a reference to a vector
- * containing references to the elements in the original `values` vector.
- *
- * # Arguments
- *
- * * `values` - A vector of values from which the permutations are chosen
- *
- * * `fun` - The function to iterate over the permutations
- */
-#[cfg(not(stage0))]
-pub fn each_permutation_ref<T>(values : &[T], fun : &fn(perm : &[&T]) -> bool) {
-    each_permutation(vec::from_fn(values.len(), |i| &values[i]), fun);
-}
-
-/**
  * Iterate over all contiguous windows of length `n` of the vector `v`.
  *
  * # Example
@@ -4828,16 +4808,6 @@ mod tests {
     }
 
     #[test]
-    fn test_permutations0_ref() {
-        let values = [];
-        let mut v : ~[~[int]] = ~[];
-        for each_permutation_ref(values) |p| {
-            v.push(p.to_owned());
-        }
-        assert_eq!(v, ~[~[]]);
-    }
-
-    #[test]
     fn test_permutations1() {
         let values = [1];
         let mut v : ~[~[int]] = ~[];
@@ -4848,16 +4818,6 @@ mod tests {
     }
 
     #[test]
-    fn test_permutations1_ref() {
-        let values = [1];
-        let mut v : ~[~[int]] = ~[];
-        for each_permutation_ref(values) |p| {
-            v.push(p.to_owned());
-        }
-        assert_eq!(v, ~[~[1]]);
-    }
-
-    #[test]
     fn test_permutations2() {
         let values = [1,2];
         let mut v : ~[~[int]] = ~[];
@@ -4868,16 +4828,6 @@ mod tests {
     }
 
     #[test]
-    fn test_permutations2_ref() {
-        let values = [1,2];
-        let mut v : ~[~[int]] = ~[];
-        for each_permutation_ref(values) |p| {
-            v.push(p.to_owned());
-        }
-        assert_eq!(v, ~[~[1,2],~[2,1]]);
-    }
-
-    #[test]
     fn test_permutations3() {
         let values = [1,2,3];
         let mut v : ~[~[int]] = ~[];
@@ -4888,16 +4838,6 @@ mod tests {
     }
 
     #[test]
-    fn test_permutations3_ref() {
-        let values = [1,2,3];
-        let mut v : ~[~[int]] = ~[];
-        for each_permutation_ref(values) |p| {
-            v.push(p.to_owned());
-        }
-        assert_eq!(v, ~[~[1,2,3],~[1,3,2],~[2,1,3],~[2,3,1],~[3,1,2],~[3,2,1]]);
-    }
-
-    #[test]
     fn test_each_val() {
         use old_iter::CopyableNonstrictIter;
         let mut i = 0;