Manual implementation of BoldIter.
This commit is contained in:
parent
df5d699a39
commit
9a1d91ae45
@ -1,4 +1,5 @@
|
|||||||
use super::ast_node::AstNode;
|
use super::ast_node::AstNode;
|
||||||
|
use crate::types::Bold;
|
||||||
use crate::types::Object;
|
use crate::types::Object;
|
||||||
|
|
||||||
pub enum AstNodeIter<'r, 's> {
|
pub enum AstNodeIter<'r, 's> {
|
||||||
@ -67,7 +68,18 @@ impl<'r, 's> Iterator for BoldIter<'r, 's> {
|
|||||||
type Item = AstNode<'r, 's>;
|
type Item = AstNode<'r, 's>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
let foo = self.next.next();
|
self.next.next().map(Into::<AstNode>::into)
|
||||||
todo!()
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'r, 's> IntoIterator for &'r Bold<'s> {
|
||||||
|
type Item = AstNode<'r, 's>;
|
||||||
|
|
||||||
|
type IntoIter = BoldIter<'r, 's>;
|
||||||
|
|
||||||
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
|
BoldIter {
|
||||||
|
next: self.children.iter(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user