Ran into issue with heading, naming this type is going to be a nightmare.
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::types::Comment;
|
||||
use crate::types::CommentBlock;
|
||||
use crate::types::DiarySexp;
|
||||
use crate::types::Document;
|
||||
use crate::types::DocumentElement;
|
||||
use crate::types::Drawer;
|
||||
use crate::types::DynamicBlock;
|
||||
use crate::types::Element;
|
||||
@@ -111,6 +112,15 @@ pub enum AstNode<'r, 's> {
|
||||
Timestamp(&'r Timestamp<'s>),
|
||||
}
|
||||
|
||||
impl<'r, 's> From<&'r DocumentElement<'s>> for AstNode<'r, 's> {
|
||||
fn from(value: &'r DocumentElement<'s>) -> Self {
|
||||
match value {
|
||||
DocumentElement::Heading(inner) => inner.into(),
|
||||
DocumentElement::Section(inner) => inner.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r, 's> From<&'r Element<'s>> for AstNode<'r, 's> {
|
||||
fn from(value: &'r Element<'s>) -> Self {
|
||||
match value {
|
||||
|
||||
Reference in New Issue
Block a user