summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-09-14 20:27:36 -0700
committerAaron Turon <aturon@mozilla.com>2014-09-16 14:37:48 -0700
commitfc525eeb4ec3443d29bce677f589b19f31c189bb (patch)
treed807bad5c91171751157a945dde963dcfd4ea95e /src/libstd/collections
parentd8dfe1957b6541de8fe2797e248fe4bd2fac02d9 (diff)
downloadrust-fc525eeb4ec3443d29bce677f589b19f31c189bb.tar.gz
rust-fc525eeb4ec3443d29bce677f589b19f31c189bb.zip
Fallout from renaming
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hashmap/map.rs20
-rw-r--r--src/libstd/collections/hashmap/set.rs14
-rw-r--r--src/libstd/collections/hashmap/table.rs2
-rw-r--r--src/libstd/collections/lru_cache.rs4
4 files changed, 23 insertions, 17 deletions
diff --git a/src/libstd/collections/hashmap/map.rs b/src/libstd/collections/hashmap/map.rs
index 4a58f4e75de..e8c5eecc6f2 100644
--- a/src/libstd/collections/hashmap/map.rs
+++ b/src/libstd/collections/hashmap/map.rs
@@ -696,7 +696,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
 
         if new_capacity < old_table.capacity() {
             // Shrink the table. Naive algorithm for resizing:
-            for (h, k, v) in old_table.move_iter() {
+            for (h, k, v) in old_table.into_iter() {
                 self.insert_hashed_nocheck(h, k, v);
             }
         } else {
@@ -943,7 +943,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     ///
     /// let new = vec!["a key", "b key", "z key"];
     ///
-    /// for k in new.move_iter() {
+    /// for k in new.into_iter() {
     ///     map.find_with_or_insert_with(
     ///         k, "new value",
     ///         // if the key does exist either prepend or append this
@@ -1214,7 +1214,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     /// map.insert("c", 3);
     ///
     /// // Update all values
-    /// for (_, val) in map.mut_iter() {
+    /// for (_, val) in map.iter_mut() {
     ///     *val *= 2;
     /// }
     ///
@@ -1223,7 +1223,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     /// }
     /// ```
     pub fn iter_mut(&mut self) -> MutEntries<K, V> {
-        MutEntries { inner: self.table.mut_iter() }
+        MutEntries { inner: self.table.iter_mut() }
     }
 
     /// Deprecated: use `into_iter`.
@@ -1247,11 +1247,11 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     /// map.insert("c", 3);
     ///
     /// // Not possible with .iter()
-    /// let vec: Vec<(&str, int)> = map.move_iter().collect();
+    /// let vec: Vec<(&str, int)> = map.into_iter().collect();
     /// ```
     pub fn into_iter(self) -> MoveEntries<K, V> {
         MoveEntries {
-            inner: self.table.move_iter().map(|(_, k, v)| (k, v))
+            inner: self.table.into_iter().map(|(_, k, v)| (k, v))
         }
     }
 }
@@ -1573,7 +1573,7 @@ mod test_map {
         drop(hm.clone());
 
         {
-            let mut half = hm.move_iter().take(50);
+            let mut half = hm.into_iter().take(50);
 
             let v = drop_vector.get().unwrap();
             for i in range(0u, 200) {
@@ -1797,7 +1797,7 @@ mod test_map {
     #[test]
     fn test_keys() {
         let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
-        let map = vec.move_iter().collect::<HashMap<int, char>>();
+        let map = vec.into_iter().collect::<HashMap<int, char>>();
         let keys = map.keys().map(|&k| k).collect::<Vec<int>>();
         assert_eq!(keys.len(), 3);
         assert!(keys.contains(&1));
@@ -1808,7 +1808,7 @@ mod test_map {
     #[test]
     fn test_values() {
         let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
-        let map = vec.move_iter().collect::<HashMap<int, char>>();
+        let map = vec.into_iter().collect::<HashMap<int, char>>();
         let values = map.values().map(|&v| v).collect::<Vec<char>>();
         assert_eq!(values.len(), 3);
         assert!(values.contains(&'a'));
@@ -1997,7 +1997,7 @@ mod test_map {
 
         let mut map: HashMap<int, int> = xs.iter().map(|&x| x).collect();
 
-        let mut iter = map.mut_iter();
+        let mut iter = map.iter_mut();
 
         for _ in iter.by_ref().take(3) {}
 
diff --git a/src/libstd/collections/hashmap/set.rs b/src/libstd/collections/hashmap/set.rs
index 4a2a04cbc9f..dde1f27c9a3 100644
--- a/src/libstd/collections/hashmap/set.rs
+++ b/src/libstd/collections/hashmap/set.rs
@@ -245,6 +245,12 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
         self.map.keys()
     }
 
+    /// Deprecated: use `into_iter`.
+    #[deprecated = "use into_iter"]
+    pub fn move_iter(self) -> SetMoveItems<T> {
+        self.into_iter()
+    }
+
     /// Creates a consuming iterator, that is, one that moves each value out
     /// of the set in arbitrary order. The set cannot be used after calling
     /// this.
@@ -258,15 +264,15 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
     /// set.insert("b".to_string());
     ///
     /// // Not possible to collect to a Vec<String> with a regular `.iter()`.
-    /// let v: Vec<String> = set.move_iter().collect();
+    /// let v: Vec<String> = set.into_iter().collect();
     ///
     /// // Will print in an arbitrary order.
     /// for x in v.iter() {
     ///     println!("{}", x);
     /// }
     /// ```
-    pub fn move_iter(self) -> SetMoveItems<T> {
-        self.map.move_iter().map(|(k, _)| k)
+    pub fn into_iter(self) -> SetMoveItems<T> {
+        self.map.into_iter().map(|(k, _)| k)
     }
 
     /// Visit the values representing the difference.
@@ -661,7 +667,7 @@ mod test_set {
             hs
         };
 
-        let v = hs.move_iter().collect::<Vec<char>>();
+        let v = hs.into_iter().collect::<Vec<char>>();
         assert!(['a', 'b'] == v.as_slice() || ['b', 'a'] == v.as_slice());
     }
 
diff --git a/src/libstd/collections/hashmap/table.rs b/src/libstd/collections/hashmap/table.rs
index 33e760f11ce..87a5cc1484a 100644
--- a/src/libstd/collections/hashmap/table.rs
+++ b/src/libstd/collections/hashmap/table.rs
@@ -872,7 +872,7 @@ impl<K, V> Drop for RawTable<K, V> {
             return;
         }
         // This is done in reverse because we've likely partially taken
-        // some elements out with `.move_iter()` from the front.
+        // some elements out with `.into_iter()` from the front.
         // Check if the size is 0, so we don't do a useless scan when
         // dropping empty tables such as on resize.
         // Also avoid double drop of elements that have been already moved out.
diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs
index 32a16053fff..5408e50f2bd 100644
--- a/src/libstd/collections/lru_cache.rs
+++ b/src/libstd/collections/lru_cache.rs
@@ -84,8 +84,8 @@ impl<K, V> LruEntry<K, V> {
         LruEntry {
             key: k,
             value: v,
-            next: ptr::mut_null(),
-            prev: ptr::mut_null(),
+            next: ptr::null_mut(),
+            prev: ptr::null_mut(),
         }
     }
 }