Remove intermediate lifetime.

This commit is contained in:
Tom Alexander
2023-10-29 14:14:10 -04:00
parent 6109902945
commit 645ae26701
60 changed files with 266 additions and 249 deletions

View File

@@ -112,20 +112,23 @@ pub(crate) enum IAstNode {
Timestamp(ITimestamp),
}
trait IntoIAstNode<'intermediate, 'parse> {
fn new<'b>(
&'intermediate self,
registry: &'b mut Registry<'intermediate, 'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>>;
pub(crate) trait IntoIAstNode {
fn into_ast_node<'parse, 'b>(
&'b self,
registry: &'b mut Registry<'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>>
where
Self: 'parse;
}
impl<'intermediate, 'parse> IntoIAstNode<'intermediate, 'parse>
for organic::types::DocumentElement<'parse>
{
fn new<'b>(
&'intermediate self,
registry: &'b mut Registry<'intermediate, 'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>> {
impl IntoIAstNode for organic::types::DocumentElement<'_> {
fn into_ast_node<'parse, 'b>(
&'b self,
registry: &'b mut Registry<'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>>
where
Self: 'parse,
{
async move {
match self {
organic::types::DocumentElement::Heading(inner) => {
@@ -140,13 +143,14 @@ impl<'intermediate, 'parse> IntoIAstNode<'intermediate, 'parse>
}
}
impl<'intermediate, 'parse> IntoIAstNode<'intermediate, 'parse>
for organic::types::Element<'parse>
{
fn new<'b>(
&'intermediate self,
registry: &'b mut Registry<'intermediate, 'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>> {
impl IntoIAstNode for organic::types::Element<'_> {
fn into_ast_node<'parse, 'b>(
&'b self,
registry: &'b mut Registry<'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>>
where
Self: 'parse,
{
async move {
match self {
organic::types::Element::Paragraph(inner) => {
@@ -227,11 +231,14 @@ impl<'intermediate, 'parse> IntoIAstNode<'intermediate, 'parse>
}
}
impl<'intermediate, 'parse> IntoIAstNode<'intermediate, 'parse> for organic::types::Object<'parse> {
fn new<'b>(
&'intermediate self,
registry: &'b mut Registry<'intermediate, 'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>> {
impl IntoIAstNode for organic::types::Object<'_> {
fn into_ast_node<'parse, 'b>(
&'b self,
registry: &'b mut Registry<'parse>,
) -> BoxFuture<'b, Result<IAstNode, CustomError>>
where
Self: 'parse,
{
async move {
match self {
organic::types::Object::Bold(inner) => {