diff options
Diffstat (limited to 'src/libcollections/hashmap.rs')
| -rw-r--r-- | src/libcollections/hashmap.rs | 12 |
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); } } |
