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