Implement ExactSizeIterator for DocumentIter.

This commit is contained in:
Tom Alexander
2023-10-10 15:19:42 -04:00
parent a873794068
commit ee5ed17c20
3 changed files with 39 additions and 27 deletions

View File

@@ -284,13 +284,7 @@ where
Ok(())
}
pub(crate) fn compare_children_iter<
'b,
's,
'x,
RC: 'x,
RI: Iterator<Item = &'x RC> + ExactSizeIterator,
>(
pub(crate) fn compare_children_iter<'b, 's, RC, RI: Iterator<Item = RC> + ExactSizeIterator>(
source: &'s str,
emacs: &'b Token<'s>,
rust_children: RI,
@@ -299,7 +293,7 @@ pub(crate) fn compare_children_iter<
message: &mut Option<String>,
) -> Result<(), Box<dyn std::error::Error>>
where
AstNode<'b, 's>: From<&'x RC>,
AstNode<'b, 's>: From<RC>,
{
let emacs_children = emacs.as_list()?;
let emacs_children_length = emacs_children.len() - 2;