Skip to content

Commit 705e295

Browse files
committed
iter: Forward ExactSizeIterator methods for &mut I
1 parent 28852c3 commit 705e295

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libcore/iter/traits.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,14 @@ pub trait ExactSizeIterator: Iterator {
552552
}
553553

554554
#[stable(feature = "rust1", since = "1.0.0")]
555-
impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I {}
555+
impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I {
556+
fn len(&self) -> usize {
557+
(**self).len()
558+
}
559+
fn is_empty(&self) -> bool {
560+
(**self).is_empty()
561+
}
562+
}
556563

557564
/// Trait to represent types that can be created by summing up an iterator.
558565
///

0 commit comments

Comments
 (0)