iter: Forward ExactSizeIterator methods for &mut I

This commit is contained in:
Ulrik Sverdrup 2016-12-03 22:47:33 +01:00
parent 28852c3c7c
commit 705e295b7b

View File

@ -552,7 +552,14 @@ pub trait ExactSizeIterator: Iterator {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I {}
impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I {
fn len(&self) -> usize {
(**self).len()
}
fn is_empty(&self) -> bool {
(**self).is_empty()
}
}
/// Trait to represent types that can be created by summing up an iterator.
///