diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-06 16:33:44 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-09 00:38:46 -0700 |
| commit | da0703973af921626d7235131d14847b1aacffc2 (patch) | |
| tree | 6b0a5c3e35c54c340553eb140019b8ab54a99df1 /src/libstd/collections | |
| parent | 50942c7695783875bd2161596036a52755ffb09c (diff) | |
| download | rust-da0703973af921626d7235131d14847b1aacffc2.tar.gz rust-da0703973af921626d7235131d14847b1aacffc2.zip | |
core: Move the collections traits to libcollections
This commit moves Mutable, Map, MutableMap, Set, and MutableSet from `core::collections` to the `collections` crate at the top-level. Additionally, this removes the `deque` module and moves the `Deque` trait to only being available at the top-level of the collections crate. All functionality continues to be reexported through `std::collections`. [breaking-change]
Diffstat (limited to 'src/libstd/collections')
| -rw-r--r-- | src/libstd/collections/hashmap.rs | 6 | ||||
| -rw-r--r-- | src/libstd/collections/lru_cache.rs | 3 | ||||
| -rw-r--r-- | src/libstd/collections/mod.rs | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/libstd/collections/hashmap.rs b/src/libstd/collections/hashmap.rs index 1f3c34600bd..a780b63bfd0 100644 --- a/src/libstd/collections/hashmap.rs +++ b/src/libstd/collections/hashmap.rs @@ -12,7 +12,7 @@ use clone::Clone; use cmp::{max, Eq, Equiv, PartialEq}; -use container::{Container, Mutable, Set, MutableSet, Map, MutableMap}; +use collections::{Collection, Mutable, Set, MutableSet, Map, MutableMap}; use default::Default; use fmt::Show; use fmt; @@ -930,7 +930,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> { } } -impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Container for HashMap<K, V, H> { +impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Collection for HashMap<K, V, H> { /// Return the number of elements in the map fn len(&self) -> uint { self.table.size() } } @@ -2160,7 +2160,7 @@ mod test_set { use super::HashSet; use slice::ImmutableEqVector; - use std::collections::Collection; + use collections::Collection; #[test] fn test_disjoint() { diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs index 5f32abfe653..72d96804d6d 100644 --- a/src/libstd/collections/lru_cache.rs +++ b/src/libstd/collections/lru_cache.rs @@ -38,8 +38,7 @@ //! ``` use cmp::{PartialEq, Eq}; -use collections::HashMap; -use container::{Container, Mutable, MutableMap}; +use collections::{HashMap, Collection, Mutable, MutableMap}; use fmt; use hash::Hash; use iter::{range, Iterator}; diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs index 16a6a35d9d5..9e5288f9541 100644 --- a/src/libstd/collections/mod.rs +++ b/src/libstd/collections/mod.rs @@ -12,10 +12,12 @@ * Collection types. */ -pub use core_collections::{Bitv, BitvSet, BTree, Deque, DList, EnumSet}; +pub use core_collections::{Collection, Mutable, Map, MutableMap}; +pub use core_collections::{Set, MutableSet, Deque}; +pub use core_collections::{Bitv, BitvSet, BTree, DList, EnumSet}; pub use core_collections::{PriorityQueue, RingBuf, SmallIntMap}; pub use core_collections::{TreeMap, TreeSet, TrieMap, TrieSet}; -pub use core_collections::{bitv, btree, deque, dlist, enum_set}; +pub use core_collections::{bitv, btree, dlist, enum_set}; pub use core_collections::{priority_queue, ringbuf, smallintmap, treemap, trie}; pub use self::hashmap::{HashMap, HashSet}; |
