diff --git a/src/iter/macros.rs b/src/iter/macros.rs index f4282496..18a265d9 100644 --- a/src/iter/macros.rs +++ b/src/iter/macros.rs @@ -79,8 +79,15 @@ $fieldname: $innertype, .or_else(|| self.$fieldname.next().map(Into::::into)) ),* } + + fn size_hint(&self) -> (usize, Option) { + let size = self.$firstfieldname.len()$( + self.$fieldname.len() ),*; + (size, Some(size)) + } } + impl<'r, 's> ExactSizeIterator for $itertype<'r, 's> {} + impl<'r, 's> IntoIterator for &'r $astnodetype { type Item = AstNode<'r, 's>;