1410: feat(runtime-core) Implement `ImportObjectIterator::size_hint`. r=MarkMcCaskey a=Hywan

Because it is helpful in some circumstances.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
This commit is contained in:
bors[bot] 2020-04-28 18:39:50 +00:00 committed by GitHub
commit 86a66e25d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,9 +192,16 @@ pub struct ImportObjectIterator {
impl Iterator for ImportObjectIterator {
type Item = (String, String, Export);
fn next(&mut self) -> Option<Self::Item> {
self.elements.pop_front()
}
fn size_hint(&self) -> (usize, Option<usize>) {
let len = self.elements.len();
(len, Some(len))
}
}
impl IntoIterator for ImportObject {