Replace old iteration with new iteration.
This commit is contained in:
@@ -69,7 +69,7 @@ use crate::types::VerseBlock;
|
||||
/// This only iterates over the children, not the starting node itself. So an AstNodeIter::PlainList would only return PlainListItems, not the PlainList.
|
||||
///
|
||||
/// This only iterates over AST nodes, so an AstNodeIter::Heading would iterate over both the title and section contents, but it would not iterate over simple strings like the TODO keyword or priority.
|
||||
pub enum AstNodeIter<'r, 's> {
|
||||
pub(crate) enum AstNodeIter<'r, 's> {
|
||||
// Document Nodes
|
||||
Document(DocumentIter<'r, 's>),
|
||||
Heading(HeadingIter<'r, 's>),
|
||||
@@ -132,7 +132,7 @@ pub enum AstNodeIter<'r, 's> {
|
||||
}
|
||||
|
||||
impl<'r, 's> AstNodeIter<'r, 's> {
|
||||
pub fn from_ast_node(node: &AstNode<'r, 's>) -> AstNodeIter<'r, 's> {
|
||||
pub(crate) fn from_ast_node(node: &AstNode<'r, 's>) -> AstNodeIter<'r, 's> {
|
||||
match node {
|
||||
AstNode::Document(inner) => AstNodeIter::Document(inner.into_iter()),
|
||||
AstNode::Heading(inner) => AstNodeIter::Heading(inner.into_iter()),
|
||||
|
||||
@@ -2,3 +2,4 @@ mod all_ast_node_iter;
|
||||
mod ast_node;
|
||||
mod ast_node_iter;
|
||||
mod macros;
|
||||
pub(crate) use ast_node::AstNode;
|
||||
|
||||
Reference in New Issue
Block a user