Impl ExactSizeIterator for multi_field_iter.
This commit is contained in:
parent
ee5ed17c20
commit
b7f7876706
@ -79,8 +79,15 @@ $fieldname: $innertype,
|
|||||||
.or_else(|| self.$fieldname.next().map(Into::<AstNode>::into))
|
.or_else(|| self.$fieldname.next().map(Into::<AstNode>::into))
|
||||||
),*
|
),*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||||
|
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 {
|
impl<'r, 's> IntoIterator for &'r $astnodetype {
|
||||||
type Item = AstNode<'r, 's>;
|
type Item = AstNode<'r, 's>;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user