diff options
| author | Florian Wilkens <floya@live.de> | 2014-12-20 15:28:20 +0100 |
|---|---|---|
| committer | Florian Wilkens <floya@live.de> | 2014-12-22 17:45:34 +0100 |
| commit | 22050e3ed44d9b4d79edced506b470a425e0d302 (patch) | |
| tree | 3490261c194034a047dad0faedabdd02acf1b21d /src/libstd | |
| parent | f8cfd2480b69a1cc266fc91d0b60c825a9dc18a7 (diff) | |
| download | rust-22050e3ed44d9b4d79edced506b470a425e0d302.tar.gz rust-22050e3ed44d9b4d79edced506b470a425e0d302.zip | |
Added missing renames:
libcollections:
AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut
DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union
libstd/hash/{table, map}:
Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut
Also a [breaking-change].
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 20 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 4 | ||||
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 16 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 8149864afd4..692f120737a 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -914,8 +914,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> { /// } /// ``` #[unstable = "matches collection reform specification, waiting for dust to settle"] - pub fn iter_mut(&mut self) -> MutEntries<K, V> { - MutEntries { inner: self.table.iter_mut() } + pub fn iter_mut(&mut self) -> IterMut<K, V> { + IterMut { inner: self.table.iter_mut() } } /// Creates a consuming iterator, that is, one that moves each key-value @@ -936,10 +936,10 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> { /// let vec: Vec<(&str, int)> = map.into_iter().collect(); /// ``` #[unstable = "matches collection reform specification, waiting for dust to settle"] - pub fn into_iter(self) -> MoveEntries<K, V> { + pub fn into_iter(self) -> IntoIter<K, V> { fn last_two<A, B, C>((_, b, c): (A, B, C)) -> (B, C) { (b, c) } - MoveEntries { + IntoIter { inner: self.table.into_iter().map(last_two) } } @@ -1306,16 +1306,16 @@ pub struct Entries<'a, K: 'a, V: 'a> { } /// HashMap mutable values iterator -pub struct MutEntries<'a, K: 'a, V: 'a> { - inner: table::MutEntries<'a, K, V> +pub struct IterMut<'a, K: 'a, V: 'a> { + inner: table::IterMut<'a, K, V> } /// HashMap move iterator -pub struct MoveEntries<K, V> { +pub struct IntoIter<K, V> { inner: iter::Map< (SafeHash, K, V), (K, V), - table::MoveEntries<K, V>, + table::IntoIter<K, V>, fn((SafeHash, K, V)) -> (K, V), > } @@ -1374,12 +1374,12 @@ impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> { #[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() } } -impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> { +impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> { #[inline] fn next(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next() } #[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() } } -impl<K, V> Iterator<(K, V)> for MoveEntries<K, V> { +impl<K, V> Iterator<(K, V)> for IntoIter<K, V> { #[inline] fn next(&mut self) -> Option<(K, V)> { self.inner.next() } #[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() } } diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index f587669d3da..a2c31591d8d 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -21,7 +21,7 @@ use iter::{Iterator, IteratorExt, FromIterator, Map, Chain, Extend}; use option::Option::{Some, None, mod}; use result::Result::{Ok, Err}; -use super::map::{mod, HashMap, MoveEntries, Keys, INITIAL_CAPACITY}; +use super::map::{mod, HashMap, Keys, INITIAL_CAPACITY}; // FIXME(conventions): implement BitOr, BitAnd, BitXor, and Sub @@ -625,7 +625,7 @@ pub struct Iter<'a, K: 'a> { /// HashSet move iterator pub struct IntoIter<K> { - iter: Map<(K, ()), K, MoveEntries<K, ()>, fn((K, ())) -> K> + iter: Map<(K, ()), K, map::IntoIter<K, ()>, fn((K, ())) -> K> } /// HashSet drain iterator diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index ce7dbd8ea5e..8f2152c5a9d 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -664,17 +664,17 @@ impl<K, V> RawTable<K, V> { } } - pub fn iter_mut(&mut self) -> MutEntries<K, V> { - MutEntries { + pub fn iter_mut(&mut self) -> IterMut<K, V> { + IterMut { iter: self.raw_buckets(), elems_left: self.size(), } } - pub fn into_iter(self) -> MoveEntries<K, V> { + pub fn into_iter(self) -> IntoIter<K, V> { let RawBuckets { raw, hashes_end, .. } = self.raw_buckets(); // Replace the marker regardless of lifetime bounds on parameters. - MoveEntries { + IntoIter { iter: RawBuckets { raw: raw, hashes_end: hashes_end, @@ -776,13 +776,13 @@ pub struct Entries<'a, K: 'a, V: 'a> { } /// Iterator over mutable references to entries in a table. -pub struct MutEntries<'a, K: 'a, V: 'a> { +pub struct IterMut<'a, K: 'a, V: 'a> { iter: RawBuckets<'a, K, V>, elems_left: uint, } /// Iterator over the entries in a table, consuming the table. -pub struct MoveEntries<K, V> { +pub struct IntoIter<K, V> { table: RawTable<K, V>, iter: RawBuckets<'static, K, V> } @@ -809,7 +809,7 @@ impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> { } } -impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> { +impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> { fn next(&mut self) -> Option<(&'a K, &'a mut V)> { self.iter.next().map(|bucket| { self.elems_left -= 1; @@ -825,7 +825,7 @@ impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> { } } -impl<K, V> Iterator<(SafeHash, K, V)> for MoveEntries<K, V> { +impl<K, V> Iterator<(SafeHash, K, V)> for IntoIter<K, V> { fn next(&mut self) -> Option<(SafeHash, K, V)> { self.iter.next().map(|bucket| { self.table.size -= 1; |
