*: implement ExactSizeIterator where possible

This commit is contained in:
meh
2015-08-25 16:13:42 +02:00
parent 62acd3ef02
commit b839b5fe2f
5 changed files with 48 additions and 0 deletions

View File

@ -113,4 +113,12 @@ impl<'a> Iterator for SideDataIter<'a> {
}
}
}
fn size_hint(&self) -> (usize, Option<usize>) {
unsafe {
((*self.ptr).nb_side_data as usize, Some((*self.ptr).nb_side_data as usize))
}
}
}
impl<'a> ExactSizeIterator for SideDataIter<'a> { }