diff --git a/src/parser/plain_text.rs b/src/parser/plain_text.rs index 123fabf..3a1a23e 100644 --- a/src/parser/plain_text.rs +++ b/src/parser/plain_text.rs @@ -37,9 +37,9 @@ fn plain_text_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s recognize(parser_with_context!(any_object_except_plain_text)(context))(input) } -impl<'x> RematchObject for PlainText<'x> { +impl<'x> RematchObject<'x> for PlainText<'x> { fn rematch_object<'r, 's>( - &self, + &'x self, _context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Object<'s>> { diff --git a/src/parser/radio_link.rs b/src/parser/radio_link.rs index cd8fe0f..1efaa6b 100644 --- a/src/parser/radio_link.rs +++ b/src/parser/radio_link.rs @@ -50,7 +50,7 @@ pub fn radio_link<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s #[tracing::instrument(ret, level = "debug")] pub fn rematch_target<'x, 'r, 's>( context: Context<'r, 's>, - target: &'x Vec>, + target: &'x Vec>, input: &'s str, ) -> Res<&'s str, Vec>> { let mut remaining = input; @@ -104,9 +104,9 @@ fn radio_target_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s alt((tag("<"), tag(">"), line_ending))(input) } -pub trait RematchObject { +pub trait RematchObject<'x> { fn rematch_object<'r, 's>( - &self, + &'x self, context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Object<'s>>; diff --git a/src/parser/text_markup.rs b/src/parser/text_markup.rs index 09f5442..fea011e 100644 --- a/src/parser/text_markup.rs +++ b/src/parser/text_markup.rs @@ -244,9 +244,9 @@ fn _text_markup_end<'r, 's, 'x>( Ok((remaining, source)) } -impl<'x> RematchObject for Bold<'x> { +impl<'x> RematchObject<'x> for Bold<'x> { fn rematch_object<'r, 's>( - &self, + &'x self, _context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Object<'s>> { @@ -262,7 +262,7 @@ fn _rematch_text_markup_object<'r, 's, 'x>( context: Context<'r, 's>, input: &'s str, marker_symbol: &'static str, - original_match_children: &'x Vec>, + original_match_children: &'x Vec>, ) -> Res<&'s str, Vec>> { let (remaining, _) = pre(context, input)?; let (remaining, open) = tag(marker_symbol)(remaining)?; @@ -290,5 +290,5 @@ fn _rematch_text_markup_object<'r, 's, 'x>( let (remaining, _close) = text_markup_end_specialized(context, remaining)?; let (remaining, _trailing_whitespace) = space0(remaining)?; - Ok((remaining, children)) + Ok((remaining, Vec::new())) }