diff --git a/src/intermediate/ast_node.rs b/src/intermediate/ast_node.rs index 0958180..5e12864 100644 --- a/src/intermediate/ast_node.rs +++ b/src/intermediate/ast_node.rs @@ -112,23 +112,18 @@ pub(crate) enum IAstNode { Timestamp(ITimestamp), } -pub(crate) trait IntoIAstNode { - fn into_ast_node<'reg, 'orig, 'parse, 'inp: 'reg + 'orig>( +pub(crate) trait IntoIAstNode<'parse> { + fn into_ast_node<'reg, 'orig, 'inp: 'reg + 'orig + 'parse>( &'orig self, registry: &'reg mut Registry<'orig, 'parse>, - ) -> BoxFuture<'inp, Result> - where - Self: 'parse; + ) -> BoxFuture<'inp, Result>; } -impl IntoIAstNode for organic::types::DocumentElement<'_> { - fn into_ast_node<'reg, 'orig, 'parse, 'inp: 'reg + 'orig>( +impl<'parse> IntoIAstNode<'parse> for organic::types::DocumentElement<'parse> { + fn into_ast_node<'reg, 'orig, 'inp: 'reg + 'orig + 'parse>( &'orig self, registry: &'reg mut Registry<'orig, 'parse>, - ) -> BoxFuture<'inp, Result> - where - Self: 'parse, - { + ) -> BoxFuture<'inp, Result> { async move { match self { organic::types::DocumentElement::Heading(inner) => { @@ -143,14 +138,11 @@ impl IntoIAstNode for organic::types::DocumentElement<'_> { } } -impl IntoIAstNode for organic::types::Element<'_> { - fn into_ast_node<'reg, 'orig, 'parse, 'inp: 'reg + 'orig>( +impl<'parse> IntoIAstNode<'parse> for organic::types::Element<'parse> { + fn into_ast_node<'reg, 'orig, 'inp: 'reg + 'orig + 'parse>( &'orig self, registry: &'reg mut Registry<'orig, 'parse>, - ) -> BoxFuture<'inp, Result> - where - Self: 'parse, - { + ) -> BoxFuture<'inp, Result> { async move { match self { organic::types::Element::Paragraph(inner) => { @@ -231,14 +223,11 @@ impl IntoIAstNode for organic::types::Element<'_> { } } -impl IntoIAstNode for organic::types::Object<'_> { - fn into_ast_node<'reg, 'orig, 'parse, 'inp: 'reg + 'orig>( +impl<'parse> IntoIAstNode<'parse> for organic::types::Object<'parse> { + fn into_ast_node<'reg, 'orig, 'inp: 'reg + 'orig + 'parse>( &'orig self, registry: &'reg mut Registry<'orig, 'parse>, - ) -> BoxFuture<'inp, Result> - where - Self: 'parse, - { + ) -> BoxFuture<'inp, Result> { async move { match self { organic::types::Object::Bold(inner) => { diff --git a/src/intermediate/macros.rs b/src/intermediate/macros.rs index 10b21c8..bb19cfd 100644 --- a/src/intermediate/macros.rs +++ b/src/intermediate/macros.rs @@ -49,12 +49,9 @@ macro_rules! iselector { registry: &'reg mut Registry<'orig, 'parse>, original: &'orig organic::types::$pstruct<'parse>, ) -> BoxFuture<'inp, Result<$istruct, CustomError>> { - async move { - let $registry = registry; - let $original = original; - $fnbody - } - .boxed() + let $registry = registry; + let $original = original; + async move { $fnbody }.boxed() } } };