Skip to content

Commit 28852c3

Browse files
committed
binary_heap: Forward ExactSizeIterator::is_empty
1 parent 343b4c3 commit 28852c3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/libcollections/binary_heap.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,11 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
986986
}
987987

988988
#[stable(feature = "rust1", since = "1.0.0")]
989-
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
989+
impl<'a, T> ExactSizeIterator for Iter<'a, T> {
990+
fn is_empty(&self) -> bool {
991+
self.iter.is_empty()
992+
}
993+
}
990994

991995
#[unstable(feature = "fused", issue = "35602")]
992996
impl<'a, T> FusedIterator for Iter<'a, T> {}
@@ -1022,7 +1026,11 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
10221026
}
10231027

10241028
#[stable(feature = "rust1", since = "1.0.0")]
1025-
impl<T> ExactSizeIterator for IntoIter<T> {}
1029+
impl<T> ExactSizeIterator for IntoIter<T> {
1030+
fn is_empty(&self) -> bool {
1031+
self.iter.is_empty()
1032+
}
1033+
}
10261034

10271035
#[unstable(feature = "fused", issue = "35602")]
10281036
impl<T> FusedIterator for IntoIter<T> {}
@@ -1057,7 +1065,11 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
10571065
}
10581066

10591067
#[stable(feature = "drain", since = "1.6.0")]
1060-
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
1068+
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {
1069+
fn is_empty(&self) -> bool {
1070+
self.iter.is_empty()
1071+
}
1072+
}
10611073

10621074
#[unstable(feature = "fused", issue = "35602")]
10631075
impl<'a, T: 'a> FusedIterator for Drain<'a, T> {}

0 commit comments

Comments
 (0)