Implement some trivial size_hints for various iterators

This also implements ExactSizeIterator where applicable.

Addresses most of the Iterator traits mentioned in #23708.
This commit is contained in:
Phlosioneer 2018-03-20 05:33:59 -04:00
parent 6bfa7d02d6
commit 619003d1d4
13 changed files with 102 additions and 0 deletions

View file

@ -602,6 +602,11 @@ impl<'a> Iterator for ListAttributesIter<'a> {
None
}
fn size_hint(&self) -> (usize, Option<usize>) {
let lower = self.current_list.len();
(lower, None)
}
}
pub trait AttributesExt {