about summary refs log tree commit diff
path: root/src/libcollections/hashmap.rs
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2014-03-20 14:12:56 +0100
committerMarvin Löbel <loebel.marvin@gmail.com>2014-03-25 21:49:55 +0100
commit6200e761f0ef58510ad2acc383b29de7e7a79bcd (patch)
tree4eb8bee6a91f0d8cbc79b33506344a56f1891e5d /src/libcollections/hashmap.rs
parent1f5571abc222520537daa00fc8256040647eec86 (diff)
Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by value
Diffstat (limited to 'src/libcollections/hashmap.rs')
-rw-r--r--src/libcollections/hashmap.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs
index 5ec5db45f27..b03cfced7cd 100644
--- a/src/libcollections/hashmap.rs
+++ b/src/libcollections/hashmap.rs
@@ -1356,7 +1356,7 @@ pub type Values<'a, K, V> =
     iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>;
 
 impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
-    fn from_iterator<T: Iterator<(K, V)>>(iter: &mut T) -> HashMap<K, V, H> {
+    fn from_iterator<T: Iterator<(K, V)>>(iter: T) -> HashMap<K, V, H> {
         let (lower, _) = iter.size_hint();
         let mut map = HashMap::with_capacity_and_hasher(lower, Default::default());
         map.extend(iter);
@@ -1365,8 +1365,8 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> fo
 }
 
 impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashMap<K, V, H> {
-    fn extend<T: Iterator<(K, V)>>(&mut self, iter: &mut T) {
-        for (k, v) in *iter {
+    fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
+        for (k, v) in iter {
             self.insert(k, v);
         }
     }
@@ -1540,7 +1540,7 @@ impl<T: TotalEq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T,
 }
 
 impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
-    fn from_iterator<I: Iterator<T>>(iter: &mut I) -> HashSet<T, H> {
+    fn from_iterator<I: Iterator<T>>(iter: I) -> HashSet<T, H> {
         let (lower, _) = iter.size_hint();
         let mut set = HashSet::with_capacity_and_hasher(lower, Default::default());
         set.extend(iter);
@@ -1549,8 +1549,8 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSe
 }
 
 impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H> {
-    fn extend<I: Iterator<T>>(&mut self, iter: &mut I) {
-        for k in *iter {
+    fn extend<I: Iterator<T>>(&mut self, mut iter: I) {
+        for k in iter {
             self.insert(k);
         }
     }