]> git.lizzy.rs Git - rust.git/commitdiff
core: Rename `container` mod to `collections`. Closes #12543
authorBrian Anderson <banderson@mozilla.com>
Mon, 19 May 2014 18:32:09 +0000 (11:32 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 9 Jun 2014 04:29:57 +0000 (21:29 -0700)
Also renames the `Container` trait to `Collection`.

[breaking-change]

47 files changed:
src/libcollections/bitv.rs
src/libcollections/dlist.rs
src/libcollections/priority_queue.rs
src/libcollections/ringbuf.rs
src/libcollections/smallintmap.rs
src/libcollections/str.rs
src/libcollections/string.rs
src/libcollections/treemap.rs
src/libcollections/trie.rs
src/libcollections/vec.rs
src/libcore/collections.rs [new file with mode: 0644]
src/libcore/container.rs [deleted file]
src/libcore/fmt/float.rs
src/libcore/fmt/mod.rs
src/libcore/fmt/num.rs
src/libcore/lib.rs
src/libcore/prelude.rs
src/libcore/should_not_exist.rs
src/libcore/slice.rs
src/libcore/str.rs
src/libregex/re.rs
src/librustc/middle/trans/adt.rs
src/librustrt/c_str.rs
src/libstd/ascii.rs
src/libstd/c_vec.rs
src/libstd/collections/hashmap.rs
src/libstd/collections/lru_cache.rs
src/libstd/comm/sync.rs
src/libstd/io/buffered.rs
src/libstd/io/comm_adapters.rs
src/libstd/io/extensions.rs
src/libstd/io/fs.rs
src/libstd/io/mem.rs
src/libstd/io/mod.rs
src/libstd/io/net/ip.rs
src/libstd/lib.rs
src/libstd/num/strconv.rs
src/libstd/os.rs
src/libstd/path/mod.rs
src/libstd/path/windows.rs
src/libstd/rt/backtrace.rs
src/libsyntax/owned_slice.rs
src/libsyntax/util/small_vector.rs
src/test/compile-fail/map-types.rs
src/test/run-pass/class-impl-very-parameterized-trait.rs
src/test/run-pass/send_str_hashmap.rs
src/test/run-pass/send_str_treemap.rs

index 79e0c2ffea877772a93700e26780ee0a0adc2f39..ac31fbbf9e43b59bc3c75e1280a4c3fa6ee5811e 100644 (file)
@@ -857,7 +857,7 @@ fn hash(&self, state: &mut S) {
     }
 }
 
-impl Container for BitvSet {
+impl Collection for BitvSet {
     #[inline]
     fn len(&self) -> uint { self.size }
 }
index 9d0e8e83698d8bac04832f23bcb5a63a7580d447..f71cc7401c58c0547298a10cb5d7fdd24d978646 100644 (file)
@@ -125,7 +125,7 @@ fn link_with_prev<T>(mut next: Box<Node<T>>, prev: Rawlink<Node<T>>)
     Some(next)
 }
 
-impl<T> Container for DList<T> {
+impl<T> Collection for DList<T> {
     /// O(1)
     #[inline]
     fn is_empty(&self) -> bool {
index 34d6bbbb66567d93ba9f69258ac3d4196b4aa5e5..f10c6f230aecb3f1d81e016db5e6ebb4d57ec411 100644 (file)
@@ -26,7 +26,7 @@ pub struct PriorityQueue<T> {
     data: Vec<T>,
 }
 
-impl<T: Ord> Container for PriorityQueue<T> {
+impl<T: Ord> Collection for PriorityQueue<T> {
     /// Returns the length of the queue
     fn len(&self) -> uint { self.data.len() }
 }
index ce4195789fab6a24060acb2aef6cae6910c45da1..5708dfaf915bc552885606b62ba845f95fdb99c6 100644 (file)
@@ -33,7 +33,7 @@ pub struct RingBuf<T> {
     elts: Vec<Option<T>>
 }
 
-impl<T> Container for RingBuf<T> {
+impl<T> Collection for RingBuf<T> {
     /// Return the number of elements in the RingBuf
     fn len(&self) -> uint { self.nelts }
 }
index 45584dd4b28ba4eccda480616bd855e23cbc1bcb..c61f518caa40eb74465815a5ed83877b388ae316 100644 (file)
@@ -29,7 +29,7 @@ pub struct SmallIntMap<T> {
     v: Vec<Option<T>>,
 }
 
-impl<V> Container for SmallIntMap<V> {
+impl<V> Collection for SmallIntMap<V> {
     /// Return the number of elements in the map
     fn len(&self) -> uint {
         self.v.iter().filter(|elt| elt.is_some()).count()
index 5fd133b450f7610717d4b7eee023daae0808bb52..102d9c3abdee9a69bf90719282fef149204b1c24 100644 (file)
@@ -610,7 +610,7 @@ fn into_string(self) -> String {
     }
 }
 
-impl<'a> Container for MaybeOwned<'a> {
+impl<'a> Collection for MaybeOwned<'a> {
     #[inline]
     fn len(&self) -> uint { self.as_slice().len() }
 }
@@ -2036,7 +2036,7 @@ fn t<S: Default + Str>() {
 
     #[test]
     fn test_str_container() {
-        fn sum_len<S: Container>(v: &[S]) -> uint {
+        fn sum_len<S: Collection>(v: &[S]) -> uint {
             v.iter().map(|x| x.len()).sum()
         }
 
index bd39c74aa840b97c4cb74907c8be13e404c06cf5..1c1d4b98592b1b7f5914e5586047b3627d6e994d 100644 (file)
@@ -279,7 +279,7 @@ pub unsafe fn as_mut_vec<'a>(&'a mut self) -> &'a mut Vec<u8> {
     }
 }
 
-impl Container for String {
+impl Collection for String {
     #[inline]
     fn len(&self) -> uint {
         self.vec.len()
index def1c353bc1324e3ea41100f96e9f96b0e7f7b0b..8d472282a68d7187dacecdec763558c93f57e6a7 100644 (file)
@@ -86,7 +86,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-impl<K: Ord, V> Container for TreeMap<K, V> {
+impl<K: Ord, V> Collection for TreeMap<K, V> {
     fn len(&self) -> uint { self.length }
 }
 
@@ -579,7 +579,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-impl<T: Ord> Container for TreeSet<T> {
+impl<T: Ord> Collection for TreeSet<T> {
     #[inline]
     fn len(&self) -> uint { self.map.len() }
 }
index c15a6e9e5bf48fae118e367c551d05a9e44796ea..1c6b7ed9333930d214819522f9b5e0e00ae89a9b 100644 (file)
@@ -38,7 +38,7 @@ pub struct TrieMap<T> {
     length: uint
 }
 
-impl<T> Container for TrieMap<T> {
+impl<T> Collection for TrieMap<T> {
     /// Return the number of elements in the map
     #[inline]
     fn len(&self) -> uint { self.length }
@@ -285,7 +285,7 @@ pub struct TrieSet {
     map: TrieMap<()>
 }
 
-impl Container for TrieSet {
+impl Collection for TrieSet {
     /// Return the number of elements in the set
     #[inline]
     fn len(&self) -> uint { self.map.len() }
index 37546f64d5f7b9690033cba19054f146bd18b322..3d0182acc7ea8768dfff9bb2e2acb0798b2dcfe6 100644 (file)
@@ -393,7 +393,7 @@ fn cmp(&self, other: &Vec<T>) -> Ordering {
     }
 }
 
-impl<T> Container for Vec<T> {
+impl<T> Collection for Vec<T> {
     #[inline]
     fn len(&self) -> uint {
         self.len
diff --git a/src/libcore/collections.rs b/src/libcore/collections.rs
new file mode 100644 (file)
index 0000000..8ebc7c2
--- /dev/null
@@ -0,0 +1,108 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Traits for generic collections (including `Map` and `Set`)
+
+use option::Option;
+
+/// A trait to represent the abstract idea of a container. The only concrete
+/// knowledge known is the number of elements contained within.
+pub trait Collection {
+    /// Return the number of elements in the container
+    fn len(&self) -> uint;
+
+    /// Return true if the container contains no elements
+    #[inline]
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+}
+
+/// A trait to represent mutable containers
+pub trait Mutable: Collection {
+    /// Clear the container, removing all values.
+    fn clear(&mut self);
+}
+
+/// A map is a key-value store where values may be looked up by their keys. This
+/// trait provides basic operations to operate on these stores.
+pub trait Map<K, V>: Collection {
+    /// Return a reference to the value corresponding to the key
+    fn find<'a>(&'a self, key: &K) -> Option<&'a V>;
+
+    /// Return true if the map contains a value for the specified key
+    #[inline]
+    fn contains_key(&self, key: &K) -> bool {
+        self.find(key).is_some()
+    }
+}
+
+/// This trait provides basic operations to modify the contents of a map.
+pub trait MutableMap<K, V>: Map<K, V> + Mutable {
+    /// Insert a key-value pair into the map. An existing value for a
+    /// key is replaced by the new value. Return true if the key did
+    /// not already exist in the map.
+    #[inline]
+    fn insert(&mut self, key: K, value: V) -> bool {
+        self.swap(key, value).is_none()
+    }
+
+    /// Remove a key-value pair from the map. Return true if the key
+    /// was present in the map, otherwise false.
+    #[inline]
+    fn remove(&mut self, key: &K) -> bool {
+        self.pop(key).is_some()
+    }
+
+    /// Insert a key-value pair from the map. If the key already had a value
+    /// present in the map, that value is returned. Otherwise None is returned.
+    fn swap(&mut self, k: K, v: V) -> Option<V>;
+
+    /// Removes a key from the map, returning the value at the key if the key
+    /// was previously in the map.
+    fn pop(&mut self, k: &K) -> Option<V>;
+
+    /// Return a mutable reference to the value corresponding to the key
+    fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>;
+}
+
+/// A set is a group of objects which are each distinct from one another. This
+/// trait represents actions which can be performed on sets to iterate over
+/// them.
+pub trait Set<T>: Collection {
+    /// Return true if the set contains a value
+    fn contains(&self, value: &T) -> bool;
+
+    /// Return true if the set has no elements in common with `other`.
+    /// This is equivalent to checking for an empty intersection.
+    fn is_disjoint(&self, other: &Self) -> bool;
+
+    /// Return true if the set is a subset of another
+    fn is_subset(&self, other: &Self) -> bool;
+
+    /// Return true if the set is a superset of another
+    fn is_superset(&self, other: &Self) -> bool {
+        other.is_subset(self)
+    }
+
+    // FIXME #8154: Add difference, sym. difference, intersection and union iterators
+}
+
+/// This trait represents actions which can be performed on sets to mutate
+/// them.
+pub trait MutableSet<T>: Set<T> + Mutable {
+    /// Add a value to the set. Return true if the value was not already
+    /// present in the set.
+    fn insert(&mut self, value: T) -> bool;
+
+    /// Remove a value from the set. Return true if the value was
+    /// present in the set.
+    fn remove(&mut self, value: &T) -> bool;
+}
diff --git a/src/libcore/container.rs b/src/libcore/container.rs
deleted file mode 100644 (file)
index e8ee379..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Traits for generic containers (including `Map` and `Set`)
-
-use option::Option;
-
-/// A trait to represent the abstract idea of a container. The only concrete
-/// knowledge known is the number of elements contained within.
-pub trait Container {
-    /// Return the number of elements in the container
-    fn len(&self) -> uint;
-
-    /// Return true if the container contains no elements
-    #[inline]
-    fn is_empty(&self) -> bool {
-        self.len() == 0
-    }
-}
-
-/// A trait to represent mutable containers
-pub trait Mutable: Container {
-    /// Clear the container, removing all values.
-    fn clear(&mut self);
-}
-
-/// A map is a key-value store where values may be looked up by their keys. This
-/// trait provides basic operations to operate on these stores.
-pub trait Map<K, V>: Container {
-    /// Return a reference to the value corresponding to the key
-    fn find<'a>(&'a self, key: &K) -> Option<&'a V>;
-
-    /// Return true if the map contains a value for the specified key
-    #[inline]
-    fn contains_key(&self, key: &K) -> bool {
-        self.find(key).is_some()
-    }
-}
-
-/// This trait provides basic operations to modify the contents of a map.
-pub trait MutableMap<K, V>: Map<K, V> + Mutable {
-    /// Insert a key-value pair into the map. An existing value for a
-    /// key is replaced by the new value. Return true if the key did
-    /// not already exist in the map.
-    #[inline]
-    fn insert(&mut self, key: K, value: V) -> bool {
-        self.swap(key, value).is_none()
-    }
-
-    /// Remove a key-value pair from the map. Return true if the key
-    /// was present in the map, otherwise false.
-    #[inline]
-    fn remove(&mut self, key: &K) -> bool {
-        self.pop(key).is_some()
-    }
-
-    /// Insert a key-value pair from the map. If the key already had a value
-    /// present in the map, that value is returned. Otherwise None is returned.
-    fn swap(&mut self, k: K, v: V) -> Option<V>;
-
-    /// Removes a key from the map, returning the value at the key if the key
-    /// was previously in the map.
-    fn pop(&mut self, k: &K) -> Option<V>;
-
-    /// Return a mutable reference to the value corresponding to the key
-    fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>;
-}
-
-/// A set is a group of objects which are each distinct from one another. This
-/// trait represents actions which can be performed on sets to iterate over
-/// them.
-pub trait Set<T>: Container {
-    /// Return true if the set contains a value
-    fn contains(&self, value: &T) -> bool;
-
-    /// Return true if the set has no elements in common with `other`.
-    /// This is equivalent to checking for an empty intersection.
-    fn is_disjoint(&self, other: &Self) -> bool;
-
-    /// Return true if the set is a subset of another
-    fn is_subset(&self, other: &Self) -> bool;
-
-    /// Return true if the set is a superset of another
-    fn is_superset(&self, other: &Self) -> bool {
-        other.is_subset(self)
-    }
-
-    // FIXME #8154: Add difference, sym. difference, intersection and union iterators
-}
-
-/// This trait represents actions which can be performed on sets to mutate
-/// them.
-pub trait MutableSet<T>: Set<T> + Mutable {
-    /// Add a value to the set. Return true if the value was not already
-    /// present in the set.
-    fn insert(&mut self, value: T) -> bool;
-
-    /// Remove a value from the set. Return true if the value was
-    /// present in the set.
-    fn remove(&mut self, value: &T) -> bool;
-}
index e5fb148aded341b64fa5db72d5faa8ecfa1dd69e..f326195be1607f270e6283c4a0830b6c9816b563 100644 (file)
@@ -11,7 +11,7 @@
 #![allow(missing_doc)]
 
 use char;
-use container::Container;
+use collections::Collection;
 use fmt;
 use iter::{Iterator, range, DoubleEndedIterator};
 use num::{Float, FPNaN, FPInfinite, ToPrimitive, Primitive};
index 2cce68d5f60f2c33198b153fbbfeff78f425eeef..37ef325d937e23d789d968c34fc2f06fdf7872fb 100644 (file)
@@ -15,7 +15,7 @@
 use any;
 use cell::Cell;
 use char::Char;
-use container::Container;
+use collections::Collection;
 use iter::{Iterator, range};
 use kinds::Copy;
 use mem;
index 890733dc229afccb033c5759aaed1e8fc290a518..f36acf344e4cfe71adb2bc5c7c59f0a5563345f2 100644 (file)
@@ -14,7 +14,7 @@
 
 #![allow(unsigned_negate)]
 
-use container::Container;
+use collections::Collection;
 use fmt;
 use iter::{Iterator, DoubleEndedIterator};
 use num::{Int, cast, zero};
index 2ccf431fc22e138fe1161601eeb8e6cbc7187bdd..5661c6683739b58ffb7b80c7d0a8218265dc7a1e 100644 (file)
 #[cfg(not(test))] pub mod cmp;
 pub mod clone;
 pub mod default;
-pub mod container;
+pub mod collections;
 
 /* Core types and methods on primitives */
 
index a6a8319ca02a5b2c965b2d480df7f7bb048516bd..df9c0e67b0d6d3ab1176df298b39aacffd3db9d4 100644 (file)
@@ -47,7 +47,7 @@
 pub use clone::Clone;
 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
 pub use cmp::{Ordering, Less, Equal, Greater, Equiv};
-pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
+pub use collections::Collection;
 pub use iter::{FromIterator, Extendable};
 pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
 pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
index 2c6f2978aa735727b4beb6a4d271ba4a3ce832b2..ed6b73df38d4d42ebb25feaac70186b6a316d2ca 100644 (file)
@@ -25,7 +25,7 @@
 // Currently, no progress has been made on this list.
 
 use clone::Clone;
-use container::Container;
+use collections::Collection;
 use finally::try_finally;
 use intrinsics;
 use iter::{range, Iterator};
index 4dea1fd75a4bf16b5923bfa6295c3ea57da661ee..585373ec70ca560cea9de2e4b4d2b953a8ca29b4 100644 (file)
@@ -16,7 +16,7 @@
 
 use mem::transmute;
 use clone::Clone;
-use container::Container;
+use collections::Collection;
 use cmp::{PartialEq, Ord, Ordering, Less, Equal, Greater};
 use cmp;
 use default::Default;
@@ -253,7 +253,7 @@ pub mod traits {
 
     use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Equiv};
     use iter::order;
-    use container::Container;
+    use collections::Collection;
 
     impl<'a,T:PartialEq> PartialEq for &'a [T] {
         fn eq(&self, other: & &'a [T]) -> bool {
@@ -347,7 +347,7 @@ impl<T> Vector<T> for ~[T] {
     fn as_slice<'a>(&'a self) -> &'a [T] { let v: &'a [T] = *self; v }
 }
 
-impl<'a, T> Container for &'a [T] {
+impl<'a, T> Collection for &'a [T] {
     /// Returns the length of a vector
     #[inline]
     fn len(&self) -> uint {
@@ -355,7 +355,7 @@ fn len(&self) -> uint {
     }
 }
 
-impl<T> Container for ~[T] {
+impl<T> Collection for ~[T] {
     /// Returns the length of a vector
     #[inline]
     fn len(&self) -> uint {
@@ -1205,7 +1205,7 @@ pub unsafe fn pop_ptr<T>(slice: &mut Slice<T>) -> Option<*T> {
 
 /// Operations on `[u8]`.
 pub mod bytes {
-    use container::Container;
+    use collections::Collection;
     use ptr;
     use slice::MutableVector;
 
index 87177b4ac90dc50430b94cbc20d8d38897e3df1f..c01997f1c42c75e48491d658d00baab15ea84c80 100644 (file)
@@ -19,7 +19,7 @@
 use clone::Clone;
 use cmp;
 use cmp::{PartialEq, Eq};
-use container::Container;
+use collections::Collection;
 use default::Default;
 use iter::{Filter, Map, Iterator};
 use iter::{DoubleEndedIterator, ExactSize};
@@ -866,7 +866,7 @@ macro_rules! utf8_acc_cont_byte(
 /// Unsafe operations
 pub mod raw {
     use mem;
-    use container::Container;
+    use collections::Collection;
     use ptr::RawPtr;
     use raw::Slice;
     use slice::{ImmutableVector};
@@ -930,8 +930,8 @@ pub unsafe fn slice_unchecked<'a>(s: &'a str, begin: uint, end: uint) -> &'a str
 #[cfg(not(test))]
 #[allow(missing_doc)]
 pub mod traits {
-    use container::Container;
     use cmp::{Ord, Ordering, Less, Equal, Greater, PartialEq, PartialOrd, Equiv, Eq};
+    use collections::Collection;
     use iter::Iterator;
     use option::{Some, None};
     use str::{Str, StrSlice, eq_slice};
@@ -987,7 +987,7 @@ impl<'a> Str for &'a str {
     fn as_slice<'a>(&'a self) -> &'a str { *self }
 }
 
-impl<'a> Container for &'a str {
+impl<'a> Collection for &'a str {
     #[inline]
     fn len(&self) -> uint {
         self.repr().len
index fbe0359ff6fa2001f7fedc0efd1ff582372cce4e..a499c1e125dede9e2ec300e2caa962a87b2a3189 100644 (file)
@@ -775,7 +775,7 @@ pub fn expand(&self, text: &str) -> String {
     }
 }
 
-impl<'t> Container for Captures<'t> {
+impl<'t> Collection for Captures<'t> {
     /// Returns the number of captured groups.
     #[inline]
     fn len(&self) -> uint {
index 5f51f80299f4be21e070459de497ffc6269b5da0..9fe403159f2b7ec3ac23bb86e262b68d194b0102 100644 (file)
@@ -45,7 +45,6 @@
 
 #![allow(unsigned_negate)]
 
-use std::container::Map;
 use libc::c_ulonglong;
 use std::num::{Bitwise};
 use std::rc::Rc;
index 4234c085148cb575acbe2856a8ba099b220c44e2..b4d9ac7efbebcce50deb04af89445f41f9756a37 100644 (file)
@@ -229,7 +229,7 @@ fn drop(&mut self) {
     }
 }
 
-impl Container for CString {
+impl Collection for CString {
     /// Return the number of bytes in the CString (not including the NUL terminator).
     ///
     /// # Failure
index e9bb23a75c88f4bd7169ebb46c48cf8414acfbf9..b9edc9a811e43486af96ba81ebc99df56c73a4de 100644 (file)
@@ -10,7 +10,7 @@
 
 //! Operations on ASCII strings and characters
 
-use container::Container;
+use collections::Collection;
 use fmt;
 use iter::Iterator;
 use mem;
index 817b54fb692f20b8e5838d53671de59ae7c2b38d..e8a158ad230aa40fac8601942b609f1480fde8ee 100644 (file)
@@ -33,7 +33,7 @@
 //! handled correctly, i.e. that allocated memory is eventually freed
 //! if necessary.
 
-use container::Container;
+use collections::Collection;
 use kinds::Send;
 use mem;
 use ops::Drop;
@@ -149,7 +149,7 @@ pub unsafe fn unwrap(mut self) -> *mut T {
     }
 }
 
-impl<T> Container for CVec<T> {
+impl<T> Collection for CVec<T> {
     fn len(&self) -> uint { self.len }
 }
 
index 571c579470441e92ee8a0ebb0e783be2467aa5ad..1f3c34600bdd420b399d99adcb717f32c20c2e47 100644 (file)
@@ -1504,7 +1504,7 @@ fn eq(&self, other: &HashSet<T, H>) -> bool {
 
 impl<T: Eq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {}
 
-impl<T: Eq + Hash<S>, S, H: Hasher<S>> Container for HashSet<T, H> {
+impl<T: Eq + Hash<S>, S, H: Hasher<S>> Collection for HashSet<T, H> {
     fn len(&self) -> uint { self.map.len() }
 }
 
@@ -2159,8 +2159,8 @@ mod test_set {
     use prelude::*;
 
     use super::HashSet;
-    use container::Container;
     use slice::ImmutableEqVector;
+    use std::collections::Collection;
 
     #[test]
     fn test_disjoint() {
index a12b00f34dc4a01fd48fd8d852d4bcf37ab2acce..5f32abfe65305eaeb96f8af4386971a08c212518 100644 (file)
@@ -227,7 +227,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-impl<K: Hash + Eq, V> Container for LruCache<K, V> {
+impl<K: Hash + Eq, V> Collection for LruCache<K, V> {
     /// Return the number of key-value pairs in the cache.
     fn len(&self) -> uint {
         self.map.len()
index 7fe505573b799bb12257a682a043fe6fde04df5d..84ef6d0aa8fcf51ecadb6afdeedd6691a43ed80c 100644 (file)
@@ -33,7 +33,7 @@
 /// of a synchronous channel. There are a few branches for the unbuffered case,
 /// but they're mostly just relevant to blocking senders.
 
-use container::Container;
+use collections::Collection;
 use iter::Iterator;
 use kinds::Send;
 use mem;
index 0d4217601624f760a7a562d5f39e7c258eb4f7a1..9450f7798edcf97c3db3c59cde615ffea6eec4b0 100644 (file)
@@ -11,7 +11,7 @@
 //! Buffering wrappers for I/O traits
 
 use cmp;
-use container::Container;
+use collections::Collection;
 use io::{Reader, Writer, Stream, Buffer, DEFAULT_BUF_SIZE, IoResult};
 use iter::ExactSize;
 use ops::Drop;
index 45f783698cd3b9b2f3812ced16d1927b5ba07ecc..a06d5aa88d66cfb0814eabc9db0f1fb6897a817d 100644 (file)
@@ -10,7 +10,7 @@
 
 use clone::Clone;
 use cmp;
-use container::Container;
+use collections::Collection;
 use comm::{Sender, Receiver};
 use io;
 use option::{None, Option, Some};
index 29afd2b1d9b2b95c5d97ca2ee9379bfdb9a972d9..d61518d4ee76f9aa36db766b634eebdf4c3a8402 100644 (file)
@@ -15,7 +15,7 @@
 // FIXME: Not sure how this should be structured
 // FIXME: Iteration should probably be considered separately
 
-use container::Container;
+use collections::Collection;
 use iter::Iterator;
 use option::{Option, Some, None};
 use result::{Ok, Err};
@@ -504,7 +504,7 @@ fn test_u64_from_be_bytes() {
 mod bench {
     extern crate test;
 
-    use container::Container;
+    use collections::Collection;
     use prelude::*;
     use self::test::Bencher;
 
index 49e8d37923661bf2c614768af0ebbb8d139e4a81..5259200133ae1974e1af84e02146849f8a2110ed 100644 (file)
@@ -51,7 +51,7 @@
 
 use c_str::ToCStr;
 use clone::Clone;
-use container::Container;
+use collections::Collection;
 use io;
 use iter::Iterator;
 use kinds::Send;
index 735966d812b92f8c0ec59d18eeda2b312ba03e89..f0fbe4529b0e959c3b6aeb88155400332cf2fdd8 100644 (file)
@@ -11,7 +11,7 @@
 //! Readers and Writers for in-memory buffers
 
 use cmp::min;
-use container::Container;
+use collections::Collection;
 use option::None;
 use result::{Err, Ok};
 use io;
index 7b655693395005ccbdb515a1f5a3155ff5a203db..6f3eec01e8e34678b8ed133e57422e44021680ba 100644 (file)
@@ -214,7 +214,7 @@ fn file_product(p: &Path) -> IoResult<u32> {
 #![deny(unused_must_use)]
 
 use char::Char;
-use container::Container;
+use collections::Collection;
 use fmt;
 use int;
 use iter::Iterator;
index bdc4b6071fab420e17893ea9333e754e9f193ba7..2c54bd895e952f59a635bf2041f0cd8d7cb324de 100644 (file)
@@ -15,7 +15,7 @@
 
 #![allow(missing_doc)]
 
-use container::Container;
+use collections::Collection;
 use fmt;
 use from_str::FromStr;
 use iter::Iterator;
index bac4d26b4e49a6e8ce114fd5ce816efd671c449b..d319d6bd03d1ad619032d13b2c15f82000282a32 100644 (file)
 pub use core::char;
 pub use core::clone;
 #[cfg(not(test))] pub use core::cmp;
-pub use core::container;
+pub use core::collections;
 pub use core::default;
 pub use core::finally;
 pub use core::intrinsics;
index 48962ca59d890235b768d8df95fea332b3b64660..5028987f44fdd239e85d9421e6867e5482d68fb1 100644 (file)
@@ -12,7 +12,7 @@
 
 use char;
 use clone::Clone;
-use container::Container;
+use collections::Collection;
 use num::{NumCast, Zero, One, cast, Int};
 use num::{Float, FPNaN, FPInfinite, ToPrimitive};
 use num;
index dd692d3fc016bdcf7544477c140e3630cb6ed0ce..90df18106f0a5b758f8a0ecf18e321ed830b346f 100644 (file)
@@ -30,7 +30,7 @@
 #![allow(non_snake_case_functions)]
 
 use clone::Clone;
-use container::Container;
+use collections::Collection;
 use fmt;
 use iter::Iterator;
 use libc::{c_void, c_int};
index 681b19a2d1ab5eb3c3a06eb4bfefdcab89e198da..a101f0432126e2ff4de213bd9303071fc42f9514 100644 (file)
@@ -65,7 +65,7 @@
 
 #![deny(deprecated_owned_vector)]
 
-use container::Container;
+use collections::Collection;
 use c_str::CString;
 use clone::Clone;
 use fmt;
index 9bb137edb82811a912391f590e1abad2f5e91562..011dfa6eeacc1e5f629164ff2b1d69b3b89fa86e 100644 (file)
@@ -14,7 +14,7 @@
 use c_str::{CString, ToCStr};
 use clone::Clone;
 use cmp::{PartialEq, Eq};
-use container::Container;
+use collections::Collection;
 use from_str::FromStr;
 use hash;
 use io::Writer;
index 766901fa04f32f663e559c16cda477b6ee2f9606..d52c63abe1b918188b9e3411c29eabed7512c832 100644 (file)
@@ -13,7 +13,7 @@
 #![allow(non_camel_case_types)]
 
 use char::Char;
-use container::Container;
+use collections::Collection;
 use from_str::from_str;
 use io::{IoResult, Writer};
 use iter::Iterator;
@@ -348,7 +348,7 @@ fn dladdr(addr: *libc::c_void,
 
     #[cfg(not(target_os = "macos"))]
     fn print(w: &mut Writer, idx: int, addr: *libc::c_void) -> IoResult<()> {
-        use container::Container;
+        use collections::Collection;
         use iter::Iterator;
         use os;
         use path::GenericPath;
index 28d63ea071a757c02721a9c57e9883de4b9d6ec9..016dd879dcd838c3ee2f915a29fe269b6117daf6 100644 (file)
@@ -121,7 +121,7 @@ fn eq(&self, other: &OwnedSlice<T>) -> bool {
 
 impl<T: Eq> Eq for OwnedSlice<T> {}
 
-impl<T> Container for OwnedSlice<T> {
+impl<T> Collection for OwnedSlice<T> {
     fn len(&self) -> uint { self.len }
 }
 
index 693407b854fb923e9a3038333071d435cbaabd4c..a3b2c23dfdf2d9b7219fdb187171a7023c187735 100644 (file)
@@ -23,7 +23,7 @@ enum SmallVectorRepr<T> {
     Many(Vec<T> ),
 }
 
-impl<T> Container for SmallVector<T> {
+impl<T> Collection for SmallVector<T> {
     fn len(&self) -> uint {
         match self.repr {
             Zero => 0,
index 0c9a7cc8bde4fbf691c00f97b24a4a3b5325b40e..61c26d4d8fd32712a0aa2c31e96a9a42f30847d7 100644 (file)
@@ -18,6 +18,6 @@ fn main() {
     let x: Box<HashMap<int, int>> = box HashMap::new();
     let x: Box<Map<int, int>> = x;
     let y: Box<Map<uint, int>> = box x;
-    //~^ ERROR failed to find an implementation of trait core::container::Map<uint,int>
-    //         for ~core::container::Map<int,int>:Send
+    //~^ ERROR failed to find an implementation of trait core::collections::Map<uint,int>
+    //         for ~core::collections::Map<int,int>:Send
 }
index 865984844c0b54314766c68be80ade3cd3a59017..924625faa1010a87338d6f025674716ae56bcee9 100644 (file)
@@ -48,7 +48,7 @@ pub fn eat(&mut self) -> bool {
     }
 }
 
-impl<T> Container for cat<T> {
+impl<T> Collection for cat<T> {
     fn len(&self) -> uint { self.meows as uint }
     fn is_empty(&self) -> bool { self.meows == 0 }
 }
index 750235ce6afedaa33caf6755081e157e76330071..8b041ed3a3e768bba07762abe4d789cec5838de3 100644 (file)
@@ -10,7 +10,7 @@
 
 extern crate collections;
 
-use std::container::{Map, MutableMap};
+use std::collections::{Map, MutableMap};
 use std::str::{SendStr, Owned, Slice};
 use std::collections::HashMap;
 use std::option::Some;
index 5604093ea9c8add7e0e0c4930b17a76c36bb2b49..68eca8f21a7f5d37c9b4a94e55a96034593bd648 100644 (file)
@@ -10,7 +10,7 @@
 
 extern crate collections;
 
-use std::container::{ Map, MutableMap};
+use std::collections::{ Map, MutableMap};
 use std::str::{SendStr, Owned, Slice};
 use std::to_str::ToStr;
 use self::collections::TreeMap;