about summary refs log tree commit diff
path: root/src/libstd/vec.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-19 19:29:58 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-23 00:35:11 -0800
commit2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0 (patch)
tree78090dacffcdda10a36a6e538f3f73d3d3a6e35c /src/libstd/vec.rs
parentedf351e9f7d17777b1385093bfa7b6654e662d44 (diff)
downloadrust-2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0.tar.gz
rust-2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0.zip
Move std::{trie, hashmap} to libcollections
These two containers are indeed collections, so their place is in
libcollections, not in libstd. There will always be a hash map as part of the
standard distribution of Rust, but by moving it out of the standard library it
makes libstd that much more portable to more platforms and environments.

This conveniently also removes the stuttering of 'std::hashmap::HashMap',
although 'collections::HashMap' is only one character shorter.
Diffstat (limited to 'src/libstd/vec.rs')
-rw-r--r--src/libstd/vec.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 0adc6083f6b..b4764f577cb 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -3395,7 +3395,6 @@ mod tests {
 
     #[test]
     fn test_permutations() {
-        use hashmap;
         {
             let v: [int, ..0] = [];
             let mut it = v.permutations();
@@ -3418,13 +3417,13 @@ mod tests {
             assert_eq!(it.next(), None);
         }
         {
-            // check that we have N! unique permutations
-            let mut set = hashmap::HashSet::new();
+            // check that we have N! permutations
             let v = ['A', 'B', 'C', 'D', 'E', 'F'];
-            for perm in v.permutations() {
-                set.insert(perm);
+            let mut amt = 0;
+            for _perm in v.permutations() {
+                amt += 1;
             }
-            assert_eq!(set.len(), 2 * 3 * 4 * 5 * 6);
+            assert_eq!(amt, 2 * 3 * 4 * 5 * 6);
         }
     }