Skip to content

Commit

Permalink
rollup merge of rust-lang#22491: Gankro/into_iter
Browse files Browse the repository at this point in the history
Conflicts:
	src/libcollections/bit.rs
	src/libcollections/linked_list.rs
	src/libcollections/vec_deque.rs
	src/libstd/sys/common/wtf8.rs
  • Loading branch information
alexcrichton committed Feb 18, 2015
2 parents 9aee389 + 66613e2 commit 5a32b4a
Show file tree
Hide file tree
Showing 28 changed files with 990 additions and 938 deletions.
7 changes: 4 additions & 3 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
fn from_iter<Iter: Iterator<Item=T>>(iter: Iter) -> BinaryHeap<T> {
BinaryHeap::from_vec(iter.collect())
fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> BinaryHeap<T> {
BinaryHeap::from_vec(iter.into_iter().collect())
}
}

Expand All @@ -677,7 +677,8 @@ impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Extend<T> for BinaryHeap<T> {
fn extend<Iter: Iterator<Item=T>>(&mut self, iter: Iter) {
fn extend<I: IntoIterator<Item=T>>(&mut self, iterable: I) {
let iter = iterable.into_iter();
let (lower, _) = iter.size_hint();

self.reserve(lower);
Expand Down
Loading

0 comments on commit 5a32b4a

Please sign in to comment.