diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 14:34:08 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 14:34:08 -0800 |
| commit | 5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48 (patch) | |
| tree | ea0ee2df4161fb0578705cd5f26635db5f3b4a1e /src/libstd/collections/hash/map.rs | |
| parent | 9aee389b6e5a58eb867f4d035729f39e694f51ec (diff) | |
| parent | 66613e26b95438c02e2f5c273c557515454121f7 (diff) | |
| download | rust-5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48.tar.gz rust-5a32b4a34fc6fbd78e293b16f7ba7d06caca7a48.zip | |
rollup merge of #22491: Gankro/into_iter
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
Diffstat (limited to 'src/libstd/collections/hash/map.rs')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index f04bbbb1f4d..04f8bb0b0db 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1534,7 +1534,8 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> { impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S> where K: Eq + Hash, S: HashState + Default { - fn from_iter<T: Iterator<Item=(K, V)>>(iter: T) -> HashMap<K, V, S> { + fn from_iter<T: IntoIterator<Item=(K, V)>>(iterable: T) -> HashMap<K, V, S> { + let iter = iterable.into_iter(); let lower = iter.size_hint().0; let mut map = HashMap::with_capacity_and_hash_state(lower, Default::default()); @@ -1547,7 +1548,7 @@ impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S> impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S> where K: Eq + Hash, S: HashState { - fn extend<T: Iterator<Item=(K, V)>>(&mut self, iter: T) { + fn extend<T: IntoIterator<Item=(K, V)>>(&mut self, iter: T) { for (k, v) in iter { self.insert(k, v); } |
