From 74a6101de7020467ccdc8ab1e6c5ac1a70438fcf Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 2 Sep 2023 22:45:46 -0400 Subject: [PATCH] Update RefContext to three lifetimes. --- src/parser/angle_link.rs | 6 ++-- src/parser/citation.rs | 10 +++---- src/parser/citation_reference.rs | 12 ++++---- src/parser/clock.rs | 6 ++-- src/parser/comment.rs | 4 +-- src/parser/diary_sexp.rs | 2 +- src/parser/document.rs | 14 ++++----- src/parser/drawer.rs | 4 +-- src/parser/dynamic_block.rs | 4 +-- src/parser/element_parser.rs | 4 +-- src/parser/entity.rs | 4 +-- src/parser/export_snippet.rs | 8 ++--- src/parser/fixed_width_area.rs | 4 +-- src/parser/footnote_definition.rs | 4 +-- src/parser/footnote_reference.rs | 10 +++---- src/parser/greater_block.rs | 4 +-- src/parser/horizontal_rule.rs | 2 +- src/parser/inline_babel_call.rs | 14 ++++----- src/parser/inline_source_block.rs | 14 ++++----- src/parser/keyword.rs | 4 +-- src/parser/latex_environment.rs | 6 ++-- src/parser/latex_fragment.rs | 26 ++++++++-------- src/parser/lesser_block.rs | 14 ++++----- src/parser/line_break.rs | 4 +-- src/parser/object_parser.rs | 10 +++---- src/parser/org_macro.rs | 8 ++--- src/parser/paragraph.rs | 4 +-- src/parser/plain_link.rs | 12 ++++---- src/parser/plain_list.rs | 16 +++++----- src/parser/plain_text.rs | 6 ++-- src/parser/planning.rs | 2 +- src/parser/property_drawer.rs | 10 +++---- src/parser/radio_link.rs | 10 +++---- src/parser/regular_link.rs | 12 ++++---- src/parser/statistics_cookie.rs | 6 ++-- src/parser/subscript_and_superscript.rs | 20 ++++++------- src/parser/table.rs | 14 ++++----- src/parser/target.rs | 4 +-- src/parser/text_markup.rs | 28 ++++++++--------- src/parser/timestamp.rs | 40 ++++++++++++------------- src/parser/util.rs | 14 ++++----- 41 files changed, 200 insertions(+), 200 deletions(-) diff --git a/src/parser/angle_link.rs b/src/parser/angle_link.rs index 519fa03..da25d49 100644 --- a/src/parser/angle_link.rs +++ b/src/parser/angle_link.rs @@ -14,7 +14,7 @@ use crate::parser::AngleLink; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn angle_link<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, AngleLink<'s>> { let (remaining, _) = tag("<")(input)?; @@ -37,7 +37,7 @@ pub fn angle_link<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn path_angle<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -54,7 +54,7 @@ fn path_angle<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn path_angle_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { tag(">")(input) diff --git a/src/parser/citation.rs b/src/parser/citation.rs index 3919e7a..babbae8 100644 --- a/src/parser/citation.rs +++ b/src/parser/citation.rs @@ -26,7 +26,7 @@ use crate::parser::Object; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn citation<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Citation<'s>> { // TODO: Despite being a standard object, citations cannot exist inside the global prefix/suffix for other citations because citations must contain something that matches @key which is forbidden inside the global prefix/suffix. This TODO is to evaluate if its worth putting in an explicit check for this (which can be easily accomplished by checking the output of `get_bracket_depth()`). I suspect its not worth it because I expect, outside of intentionally crafted inputs, this parser will exit immediately inside a citation since it is unlikely to find the "[cite" substring inside a citation global prefix/suffix. @@ -78,7 +78,7 @@ fn variant<'r, 's>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn global_prefix<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let exit_with_depth = global_prefix_end(input.get_bracket_depth()); @@ -108,7 +108,7 @@ fn global_prefix_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _global_prefix_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { @@ -131,7 +131,7 @@ fn _global_prefix_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn global_suffix<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let exit_with_depth = global_suffix_end(input.get_bracket_depth()); @@ -160,7 +160,7 @@ fn global_suffix_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _global_suffix_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/citation_reference.rs b/src/parser/citation_reference.rs index bd4e832..8b3c5b1 100644 --- a/src/parser/citation_reference.rs +++ b/src/parser/citation_reference.rs @@ -24,7 +24,7 @@ use crate::parser::Object; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn citation_reference<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, CitationReference<'s>> { let (remaining, _prefix) = @@ -44,7 +44,7 @@ pub fn citation_reference<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn citation_reference_key<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, source) = recognize(tuple(( @@ -64,7 +64,7 @@ pub fn citation_reference_key<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn key_prefix<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let exit_with_depth = key_prefix_end(input.get_bracket_depth()); @@ -85,7 +85,7 @@ fn key_prefix<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn key_suffix<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let exit_with_depth = key_suffix_end(input.get_bracket_depth()); @@ -114,7 +114,7 @@ fn key_prefix_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _key_prefix_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { @@ -145,7 +145,7 @@ fn key_suffix_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _key_suffix_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/clock.rs b/src/parser/clock.rs index 759f54f..31af225 100644 --- a/src/parser/clock.rs +++ b/src/parser/clock.rs @@ -19,7 +19,7 @@ use crate::parser::Clock; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn clock<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Clock<'s>> { start_of_line(input)?; @@ -43,7 +43,7 @@ pub fn clock<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_timestamp_range_duration<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple(( @@ -65,7 +65,7 @@ fn inactive_timestamp_range_duration<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_timestamp<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple(( diff --git a/src/parser/comment.rs b/src/parser/comment.rs index a2e74d6..931ab97 100644 --- a/src/parser/comment.rs +++ b/src/parser/comment.rs @@ -23,7 +23,7 @@ use crate::parser::Comment; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn comment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Comment<'s>> { if immediate_in_section(context, "comment") { @@ -49,7 +49,7 @@ pub fn comment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn comment_line<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { start_of_line(input)?; diff --git a/src/parser/diary_sexp.rs b/src/parser/diary_sexp.rs index 67fbc5f..9fb724e 100644 --- a/src/parser/diary_sexp.rs +++ b/src/parser/diary_sexp.rs @@ -18,7 +18,7 @@ use crate::parser::DiarySexp; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn diary_sexp<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, DiarySexp<'s>> { start_of_line(input)?; diff --git a/src/parser/document.rs b/src/parser/document.rs index d5b6c1f..68db3da 100644 --- a/src/parser/document.rs +++ b/src/parser/document.rs @@ -71,7 +71,7 @@ pub fn document(input: &str) -> Res<&str, Document> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _document<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Document<'s>> { let zeroth_section_matcher = parser_with_context!(zeroth_section)(context); @@ -92,7 +92,7 @@ fn _document<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn zeroth_section<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Section<'s>> { // TODO: The zeroth section is specialized so it probably needs its own parser @@ -146,7 +146,7 @@ fn zeroth_section<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn section<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, mut input: OrgSource<'s>, ) -> Res, Section<'s>> { // TODO: The zeroth section is specialized so it probably needs its own parser @@ -196,7 +196,7 @@ fn section<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn section_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(detect_headline)(input) @@ -210,7 +210,7 @@ const fn heading( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _heading<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, parent_stars: usize, ) -> Res, Heading<'s>> { @@ -257,7 +257,7 @@ fn detect_headline<'s>(input: OrgSource<'s>) -> Res, ()> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn headline<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, parent_stars: usize, ) -> Res< @@ -312,7 +312,7 @@ fn headline<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn headline_title_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple(( diff --git a/src/parser/drawer.rs b/src/parser/drawer.rs index c5b7646..f794a3f 100644 --- a/src/parser/drawer.rs +++ b/src/parser/drawer.rs @@ -27,7 +27,7 @@ use crate::parser::Paragraph; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn drawer<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Drawer<'s>> { if immediate_in_section(context, "drawer") { @@ -93,7 +93,7 @@ fn name<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn drawer_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { start_of_line(input)?; diff --git a/src/parser/dynamic_block.rs b/src/parser/dynamic_block.rs index c9ecc57..7625fde 100644 --- a/src/parser/dynamic_block.rs +++ b/src/parser/dynamic_block.rs @@ -27,7 +27,7 @@ use crate::parser::Element; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn dynamic_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, DynamicBlock<'s>> { // TODO: Do I need to differentiate between different dynamic block types. @@ -101,7 +101,7 @@ fn parameters<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn dynamic_block_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { start_of_line(input)?; diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 8d40274..18ec00b 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -39,7 +39,7 @@ pub const fn element( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _element<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, can_be_paragraph: bool, ) -> Res, Element<'s>> { @@ -121,7 +121,7 @@ pub const fn detect_element( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _detect_element<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, can_be_paragraph: bool, ) -> Res, ()> { diff --git a/src/parser/entity.rs b/src/parser/entity.rs index b9420d1..dd29793 100644 --- a/src/parser/entity.rs +++ b/src/parser/entity.rs @@ -433,7 +433,7 @@ const ORG_ENTITIES: [&'static str; 413] = [ #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn entity<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Entity<'s>> { let (remaining, _) = tag("\\")(input)?; @@ -454,7 +454,7 @@ pub fn entity<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn name<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // TODO: This should be defined by org-entities and optionally org-entities-user diff --git a/src/parser/export_snippet.rs b/src/parser/export_snippet.rs index 839a1aa..a294ab7 100644 --- a/src/parser/export_snippet.rs +++ b/src/parser/export_snippet.rs @@ -16,7 +16,7 @@ use crate::parser::ExportSnippet; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn export_snippet<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, ExportSnippet<'s>> { let (remaining, _) = tag("@@")(input)?; @@ -46,7 +46,7 @@ pub fn export_snippet<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn backend<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, backend_name) = @@ -57,7 +57,7 @@ fn backend<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn contents<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, source) = recognize(verify( @@ -69,7 +69,7 @@ fn contents<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn export_snippet_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { tag("@@")(input) diff --git a/src/parser/fixed_width_area.rs b/src/parser/fixed_width_area.rs index 4d29795..6a44d5b 100644 --- a/src/parser/fixed_width_area.rs +++ b/src/parser/fixed_width_area.rs @@ -20,7 +20,7 @@ use crate::parser::FixedWidthArea; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn fixed_width_area<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FixedWidthArea<'s>> { let fixed_width_area_line_matcher = parser_with_context!(fixed_width_area_line)(context); @@ -40,7 +40,7 @@ pub fn fixed_width_area<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn fixed_width_area_line<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { start_of_line(input)?; diff --git a/src/parser/footnote_definition.rs b/src/parser/footnote_definition.rs index 24eff27..0bd1089 100644 --- a/src/parser/footnote_definition.rs +++ b/src/parser/footnote_definition.rs @@ -26,7 +26,7 @@ use crate::parser::util::start_of_line; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn footnote_definition<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FootnoteDefinition<'s>> { if immediate_in_section(context, "footnote definition") { @@ -72,7 +72,7 @@ pub fn label<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn footnote_definition_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, source) = alt(( diff --git a/src/parser/footnote_reference.rs b/src/parser/footnote_reference.rs index 27c2a2c..20462c3 100644 --- a/src/parser/footnote_reference.rs +++ b/src/parser/footnote_reference.rs @@ -18,7 +18,7 @@ use crate::parser::FootnoteReference; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn footnote_reference<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FootnoteReference<'s>> { alt(( @@ -30,7 +30,7 @@ pub fn footnote_reference<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn anonymous_footnote<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FootnoteReference<'s>> { let (remaining, _) = tag_no_case("[fn::")(input)?; @@ -64,7 +64,7 @@ fn anonymous_footnote<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inline_footnote<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FootnoteReference<'s>> { let (remaining, _) = tag_no_case("[fn:")(input)?; @@ -100,7 +100,7 @@ fn inline_footnote<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn footnote_reference_only<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, FootnoteReference<'s>> { let (remaining, _) = tag_no_case("[fn:")(input)?; @@ -129,7 +129,7 @@ fn footnote_definition_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _footnote_definition_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/greater_block.rs b/src/parser/greater_block.rs index 4cc6113..22a5018 100644 --- a/src/parser/greater_block.rs +++ b/src/parser/greater_block.rs @@ -27,7 +27,7 @@ use crate::parser::Paragraph; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn greater_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, GreaterBlock<'s>> { // TODO: Do I need to differentiate between different greater block types. @@ -124,7 +124,7 @@ fn greater_block_end<'x>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _greater_block_end<'r, 's, 'x>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, name: &'x str, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/horizontal_rule.rs b/src/parser/horizontal_rule.rs index f5ed6ca..1429a91 100644 --- a/src/parser/horizontal_rule.rs +++ b/src/parser/horizontal_rule.rs @@ -15,7 +15,7 @@ use crate::parser::HorizontalRule; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn horizontal_rule<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, HorizontalRule<'s>> { start_of_line(input)?; diff --git a/src/parser/inline_babel_call.rs b/src/parser/inline_babel_call.rs index 5300bf4..e059f50 100644 --- a/src/parser/inline_babel_call.rs +++ b/src/parser/inline_babel_call.rs @@ -21,7 +21,7 @@ use crate::parser::InlineBabelCall; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn inline_babel_call<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, InlineBabelCall<'s>> { let (remaining, _) = tag_no_case("call_")(input)?; @@ -42,7 +42,7 @@ pub fn inline_babel_call<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn name<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -59,7 +59,7 @@ fn name<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn name_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(one_of("[("))(input) @@ -67,7 +67,7 @@ fn name_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn header<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("[")(input)?; @@ -97,7 +97,7 @@ fn header_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _header_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { @@ -117,7 +117,7 @@ fn _header_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn argument<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("(")(input)?; @@ -147,7 +147,7 @@ fn argument_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _argument_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_parenthesis_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/inline_source_block.rs b/src/parser/inline_source_block.rs index 941dc87..132163f 100644 --- a/src/parser/inline_source_block.rs +++ b/src/parser/inline_source_block.rs @@ -23,7 +23,7 @@ use crate::parser::InlineSourceBlock; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn inline_source_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, InlineSourceBlock<'s>> { let (remaining, _) = tag_no_case("src_")(input)?; @@ -43,7 +43,7 @@ pub fn inline_source_block<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn lang<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -60,7 +60,7 @@ fn lang<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn lang_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(one_of("[{"))(input) @@ -68,7 +68,7 @@ fn lang_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn header<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("[")(input)?; @@ -98,7 +98,7 @@ fn header_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _header_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_bracket_depth: BracketDepth, ) -> Res, OrgSource<'s>> { @@ -118,7 +118,7 @@ fn _header_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn body<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("{")(input)?; @@ -156,7 +156,7 @@ fn body_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _body_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_brace_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/keyword.rs b/src/parser/keyword.rs index 99053d9..a3be43a 100644 --- a/src/parser/keyword.rs +++ b/src/parser/keyword.rs @@ -30,7 +30,7 @@ const ORG_ELEMENT_DUAL_KEYWORDS: [&'static str; 2] = ["caption", "results"]; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn keyword<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Keyword<'s>> { start_of_line(input)?; @@ -55,7 +55,7 @@ pub fn keyword<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn affiliated_keyword<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Keyword<'s>> { start_of_line(input)?; diff --git a/src/parser/latex_environment.rs b/src/parser/latex_environment.rs index 4a71ef6..7a9320f 100644 --- a/src/parser/latex_environment.rs +++ b/src/parser/latex_environment.rs @@ -20,7 +20,7 @@ use crate::parser::LatexEnvironment; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn latex_environment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, LatexEnvironment<'s>> { start_of_line(input)?; @@ -67,7 +67,7 @@ pub fn contents< F: Fn(Context<'r, 's>, OrgSource<'s>) -> Res, OrgSource<'s>>, >( end_matcher: F, - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, source) = recognize(many_till( @@ -92,7 +92,7 @@ fn latex_environment_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _latex_environment_end<'r, 's, 'x>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, current_name_lower: &'x str, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/latex_fragment.rs b/src/parser/latex_fragment.rs index a4b54f9..077c0c1 100644 --- a/src/parser/latex_fragment.rs +++ b/src/parser/latex_fragment.rs @@ -23,7 +23,7 @@ use crate::parser::LatexFragment; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn latex_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, LatexFragment<'s>> { let (remaining, _) = alt(( @@ -47,7 +47,7 @@ pub fn latex_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn raw_latex_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("\\")(input)?; @@ -60,7 +60,7 @@ fn raw_latex_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn name<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alpha1(input) @@ -68,7 +68,7 @@ fn name<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn brackets<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, body) = alt(( @@ -100,7 +100,7 @@ fn brackets<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn escaped_parenthesis_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("\\(")(input)?; @@ -119,7 +119,7 @@ fn escaped_parenthesis_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn escaped_bracket_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = tag("\\[")(input)?; @@ -138,7 +138,7 @@ fn escaped_bracket_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn double_dollar_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // TODO: The documentation on the dollar sign versions is incomplete. Test to figure out what the real requirements are. For example, can this span more than 3 lines and can this contain a single $ since its terminated by $$? @@ -158,7 +158,7 @@ fn double_dollar_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn dollar_char_fragment<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (_, _) = pre(context, input)?; @@ -172,7 +172,7 @@ fn dollar_char_fragment<'r, 's>( } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +pub fn pre<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let preceding_character = input.get_preceding_character(); if let Some('$') = preceding_character { return Err(nom::Err::Error(CustomError::MyError(MyError( @@ -183,7 +183,7 @@ pub fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +pub fn post<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { // TODO: What about eof? Test to find out. // TODO: Figure out which punctuation characters should be included. @@ -193,7 +193,7 @@ pub fn post<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (_, _) = pre(context, input)?; @@ -219,7 +219,7 @@ fn bordered_dollar_fragment<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn open_border<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(verify(none_of(".,;$"), |c| !c.is_whitespace()))(input) @@ -227,7 +227,7 @@ pub fn open_border<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn close_border<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, ()> { let preceding_character = input.get_preceding_character(); diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index eb241cc..8a78b6a 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -29,7 +29,7 @@ use crate::parser::util::text_until_exit; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn verse_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, VerseBlock<'s>> { let (remaining, name) = lesser_block_begin("verse")(context, input)?; @@ -80,7 +80,7 @@ pub fn verse_block<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn comment_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, CommentBlock<'s>> { let (remaining, name) = lesser_block_begin("comment")(context, input)?; @@ -116,7 +116,7 @@ pub fn comment_block<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn example_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, ExampleBlock<'s>> { let (remaining, _name) = lesser_block_begin("example")(context, input)?; @@ -152,7 +152,7 @@ pub fn example_block<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn export_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, ExportBlock<'s>> { let (remaining, name) = lesser_block_begin("export")(context, input)?; @@ -189,7 +189,7 @@ pub fn export_block<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn src_block<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, SrcBlock<'s>> { let (remaining, name) = lesser_block_begin("src")(context, input)?; @@ -245,7 +245,7 @@ fn lesser_block_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _lesser_block_end<'r, 's, 'x>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, current_name_lower: &'x str, ) -> Res, OrgSource<'s>> { @@ -272,7 +272,7 @@ const fn lesser_block_begin( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _lesser_block_begin<'r, 's, 'x>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, current_name_lower: &'x str, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/line_break.rs b/src/parser/line_break.rs index 33a68a7..8f2cb27 100644 --- a/src/parser/line_break.rs +++ b/src/parser/line_break.rs @@ -13,7 +13,7 @@ use crate::parser::LineBreak; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn line_break<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, LineBreak<'s>> { let (remaining, _) = pre(context, input)?; @@ -30,7 +30,7 @@ pub fn line_break<'r, 's>( } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +fn pre<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let preceding_character = input.get_preceding_character(); match preceding_character { // If None, we are at the start of the file diff --git a/src/parser/object_parser.rs b/src/parser/object_parser.rs index b314af1..084d526 100644 --- a/src/parser/object_parser.rs +++ b/src/parser/object_parser.rs @@ -29,7 +29,7 @@ use crate::parser::timestamp::timestamp; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn standard_set_object<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { let (remaining, object) = alt(( @@ -87,7 +87,7 @@ pub fn standard_set_object<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn minimal_set_object<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { let (remaining, object) = alt(( @@ -109,7 +109,7 @@ pub fn minimal_set_object<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn any_object_except_plain_text<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { let (remaining, object) = alt(( @@ -166,7 +166,7 @@ pub fn any_object_except_plain_text<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn regular_link_description_object_set<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { // TODO: It can also contain another link, but only when it is a plain or angle link. It can contain square brackets, but not ]] @@ -195,7 +195,7 @@ pub fn regular_link_description_object_set<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn table_cell_set_object<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { let (remaining, object) = alt(( diff --git a/src/parser/org_macro.rs b/src/parser/org_macro.rs index 70e8447..71f2dd6 100644 --- a/src/parser/org_macro.rs +++ b/src/parser/org_macro.rs @@ -18,7 +18,7 @@ use crate::parser::util::get_consumed; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_macro<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgMacro<'s>> { let (remaining, _) = tag("{{{")(input)?; @@ -45,7 +45,7 @@ pub fn org_macro<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn org_macro_name<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _) = verify(anychar, |c| c.is_alphabetic())(input)?; @@ -58,7 +58,7 @@ fn org_macro_name<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn org_macro_args<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let (remaining, _) = tag("(")(input)?; @@ -71,7 +71,7 @@ fn org_macro_args<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn org_macro_arg<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let mut remaining = input; diff --git a/src/parser/paragraph.rs b/src/parser/paragraph.rs index 59f4bb5..c275f6d 100644 --- a/src/parser/paragraph.rs +++ b/src/parser/paragraph.rs @@ -19,7 +19,7 @@ use crate::parser::util::start_of_line; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn paragraph<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Paragraph<'s>> { let parser_context = @@ -50,7 +50,7 @@ pub fn paragraph<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn paragraph_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let non_paragraph_element_matcher = parser_with_context!(detect_element(false))(context); diff --git a/src/parser/plain_link.rs b/src/parser/plain_link.rs index bf7880a..1cf2b36 100644 --- a/src/parser/plain_link.rs +++ b/src/parser/plain_link.rs @@ -49,7 +49,7 @@ const ORG_LINK_PARAMETERS: [&'static str; 23] = [ #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn plain_link<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, PlainLink<'s>> { let (remaining, _) = pre(context, input)?; @@ -69,7 +69,7 @@ pub fn plain_link<'r, 's>( } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +fn pre<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let preceding_character = input.get_preceding_character(); match preceding_character { // If None, we are at the start of the file which is fine @@ -86,14 +86,14 @@ fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +fn post<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let (remaining, _) = alt((eof, recognize(none_of(WORD_CONSTITUENT_CHARACTERS))))(input)?; Ok((remaining, ())) } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn protocol<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // TODO: This should be defined by org-link-parameters @@ -114,7 +114,7 @@ pub fn protocol<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn path_plain<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // TODO: "optionally containing parenthesis-wrapped non-whitespace non-bracket substrings up to a depth of two. The string must end with either a non-punctation non-whitespace character, a forwards slash, or a parenthesis-wrapped substring" @@ -136,7 +136,7 @@ fn path_plain<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn path_plain_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(many_till( diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 929d273..0007853 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -56,7 +56,7 @@ pub fn detect_plain_list<'s>(input: OrgSource<'s>) -> Res, ()> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn plain_list<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, PlainList<'s>> { let parser_context = context @@ -125,7 +125,7 @@ pub fn plain_list<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn plain_list_item<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, PlainListItem<'s>> { start_of_line(input)?; @@ -236,7 +236,7 @@ fn counter<'s>(i: OrgSource<'s>) -> Res, OrgSource<'s>> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn plain_list_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple(( @@ -261,7 +261,7 @@ const fn plain_list_item_end( tracing::instrument(ret, level = "debug", skip(line_indented_lte_matcher)) )] fn _plain_list_item_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, line_indented_lte_matcher: impl for<'rr, 'ss> Fn( Context<'rr, 'ss>, @@ -283,7 +283,7 @@ const fn line_indented_lte( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _line_indented_lte<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, indent_level: usize, ) -> Res, OrgSource<'s>> { @@ -298,7 +298,7 @@ fn _line_indented_lte<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn item_tag<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let parser_context = @@ -319,7 +319,7 @@ fn item_tag<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn item_tag_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(alt(( @@ -331,7 +331,7 @@ fn item_tag_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn item_tag_post_gap<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { verify( diff --git a/src/parser/plain_text.rs b/src/parser/plain_text.rs index 916f0fa..96f9c02 100644 --- a/src/parser/plain_text.rs +++ b/src/parser/plain_text.rs @@ -16,7 +16,7 @@ use crate::error::Res; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn plain_text<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, PlainText<'s>> { let (remaining, source) = recognize(verify( @@ -40,7 +40,7 @@ pub fn plain_text<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn plain_text_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(parser_with_context!(any_object_except_plain_text)(context))(input) @@ -50,7 +50,7 @@ impl<'x> RematchObject<'x> for PlainText<'x> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn rematch_object<'r, 's>( &'x self, - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { map(tag(self.source), |s| { diff --git a/src/parser/planning.rs b/src/parser/planning.rs index 8d1ae8c..e2e76e1 100644 --- a/src/parser/planning.rs +++ b/src/parser/planning.rs @@ -18,7 +18,7 @@ use crate::parser::util::start_of_line; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn planning<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Planning<'s>> { start_of_line(input)?; diff --git a/src/parser/property_drawer.rs b/src/parser/property_drawer.rs index b5affb7..f9b380e 100644 --- a/src/parser/property_drawer.rs +++ b/src/parser/property_drawer.rs @@ -27,7 +27,7 @@ use crate::parser::util::start_of_line; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn property_drawer<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, PropertyDrawer<'s>> { if immediate_in_section(context, "property-drawer") { @@ -75,7 +75,7 @@ pub fn property_drawer<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn property_drawer_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple(( @@ -89,7 +89,7 @@ fn property_drawer_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn node_property<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, NodeProperty<'s>> { let (remaining, (_start_of_line, _leading_whitespace, _open_colon, _name, _close_colon)) = @@ -132,7 +132,7 @@ fn node_property<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn node_property_name<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -157,7 +157,7 @@ fn node_property_name<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn node_property_name_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alt((tag("+:"), tag(":")))(input) diff --git a/src/parser/radio_link.rs b/src/parser/radio_link.rs index de78303..5a3a64e 100644 --- a/src/parser/radio_link.rs +++ b/src/parser/radio_link.rs @@ -18,7 +18,7 @@ use crate::parser::RadioTarget; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn radio_link<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, RadioLink<'s>> { let radio_targets = context @@ -49,7 +49,7 @@ pub fn radio_link<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn rematch_target<'x, 'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, target: &'x Vec>, input: OrgSource<'s>, ) -> Res, Vec>> { @@ -80,7 +80,7 @@ pub fn rematch_target<'x, 'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn radio_target<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, RadioTarget<'s>> { let (remaining, _opening) = tag("<<<")(input)?; @@ -113,7 +113,7 @@ pub fn radio_target<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn radio_target_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alt((tag("<"), tag(">"), line_ending))(input) @@ -122,7 +122,7 @@ fn radio_target_end<'r, 's>( pub trait RematchObject<'x> { fn rematch_object<'r, 's>( &'x self, - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>>; } diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index b64ebf3..cf751bb 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -16,7 +16,7 @@ use crate::error::Res; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn regular_link<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, RegularLink<'s>> { alt(( @@ -27,7 +27,7 @@ pub fn regular_link<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn regular_link_without_description<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, RegularLink<'s>> { let (remaining, _opening_bracket) = tag("[[")(input)?; @@ -46,7 +46,7 @@ pub fn regular_link_without_description<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn regular_link_with_description<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, RegularLink<'s>> { let (remaining, _opening_bracket) = tag("[[")(input)?; @@ -67,7 +67,7 @@ pub fn regular_link_with_description<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn pathreg<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, path) = escaped( @@ -83,7 +83,7 @@ pub fn pathreg<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn description<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let parser_context = @@ -104,7 +104,7 @@ pub fn description<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn description_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { tag("]]")(input) diff --git a/src/parser/statistics_cookie.rs b/src/parser/statistics_cookie.rs index 180dd49..3fd2287 100644 --- a/src/parser/statistics_cookie.rs +++ b/src/parser/statistics_cookie.rs @@ -11,7 +11,7 @@ use crate::parser::StatisticsCookie; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn statistics_cookie<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, StatisticsCookie<'s>> { alt(( @@ -22,7 +22,7 @@ pub fn statistics_cookie<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn percent_statistics_cookie<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, StatisticsCookie<'s>> { let (remaining, source) = @@ -39,7 +39,7 @@ pub fn percent_statistics_cookie<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn fraction_statistics_cookie<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, StatisticsCookie<'s>> { let (remaining, source) = recognize(tuple(( diff --git a/src/parser/subscript_and_superscript.rs b/src/parser/subscript_and_superscript.rs index e5233f8..8463a40 100644 --- a/src/parser/subscript_and_superscript.rs +++ b/src/parser/subscript_and_superscript.rs @@ -24,7 +24,7 @@ use crate::parser::Superscript; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn subscript<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Subscript<'s>> { // We check for the underscore first before checking the pre-character as a minor optimization to avoid walking up the context tree to find the document root unnecessarily. @@ -44,7 +44,7 @@ pub fn subscript<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn superscript<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Superscript<'s>> { // We check for the circumflex first before checking the pre-character as a minor optimization to avoid walking up the context tree to find the document root unnecessarily. @@ -63,7 +63,7 @@ pub fn superscript<'r, 's>( } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +fn pre<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let preceding_character = input.get_preceding_character(); match preceding_character { Some(c) if !c.is_whitespace() => {} @@ -84,7 +84,7 @@ enum ScriptBody<'s> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn script_body<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, ScriptBody<'s>> { alt(( @@ -102,7 +102,7 @@ fn script_body<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn script_asterisk<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { tag("*")(input) @@ -110,7 +110,7 @@ fn script_asterisk<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn script_alphanum<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _sign) = opt(recognize(one_of("+-")))(input)?; @@ -124,7 +124,7 @@ fn script_alphanum<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn script_alphanum_character<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(verify(anychar, |c| { @@ -134,7 +134,7 @@ fn script_alphanum_character<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn end_script_alphanum_character<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, final_char) = recognize(verify(anychar, |c| c.is_alphanumeric()))(input)?; @@ -146,7 +146,7 @@ fn end_script_alphanum_character<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn script_with_braces<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Vec>> { let (remaining, _) = tag("{")(input)?; @@ -176,7 +176,7 @@ fn script_with_braces_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _script_with_braces_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, starting_brace_depth: BracketDepth, ) -> Res, OrgSource<'s>> { diff --git a/src/parser/table.rs b/src/parser/table.rs index 121f421..eeb3c1a 100644 --- a/src/parser/table.rs +++ b/src/parser/table.rs @@ -26,7 +26,7 @@ use crate::parser::Table; /// This is not the table.el style. #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_mode_table<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Table<'s>> { start_of_line(input)?; @@ -60,7 +60,7 @@ pub fn org_mode_table<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn table_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { start_of_line(input)?; @@ -69,7 +69,7 @@ fn table_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_mode_table_row<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, TableRow<'s>> { alt(( @@ -80,7 +80,7 @@ pub fn org_mode_table_row<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_mode_table_row_rule<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, TableRow<'s>> { start_of_line(input)?; @@ -97,7 +97,7 @@ pub fn org_mode_table_row_rule<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_mode_table_row_regular<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, TableRow<'s>> { start_of_line(input)?; @@ -117,7 +117,7 @@ pub fn org_mode_table_row_regular<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn org_mode_table_cell<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, TableCell<'s>> { let parser_context = @@ -150,7 +150,7 @@ pub fn org_mode_table_cell<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn org_mode_table_cell_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(tuple((space0, alt((tag("|"), peek(line_ending))))))(input) diff --git a/src/parser/target.rs b/src/parser/target.rs index ddbc1f5..ebb53b7 100644 --- a/src/parser/target.rs +++ b/src/parser/target.rs @@ -17,7 +17,7 @@ use crate::parser::Target; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn target<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Target<'s>> { let (remaining, _) = tag("<<")(input)?; @@ -58,7 +58,7 @@ pub fn target<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn target_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(one_of("<>\n"))(input) diff --git a/src/parser/text_markup.rs b/src/parser/text_markup.rs index d80b4fd..117b9d3 100644 --- a/src/parser/text_markup.rs +++ b/src/parser/text_markup.rs @@ -36,7 +36,7 @@ use crate::parser::Verbatim; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn text_markup<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { alt(( @@ -54,7 +54,7 @@ pub fn text_markup<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn bold<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Bold<'s>> { let text_markup_object_specialized = text_markup_object("*"); @@ -71,7 +71,7 @@ pub fn bold<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn italic<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Italic<'s>> { let text_markup_object_specialized = text_markup_object("/"); @@ -88,7 +88,7 @@ pub fn italic<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn underline<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Underline<'s>> { let text_markup_object_specialized = text_markup_object("_"); @@ -105,7 +105,7 @@ pub fn underline<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn strike_through<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, StrikeThrough<'s>> { let text_markup_object_specialized = text_markup_object("+"); @@ -122,7 +122,7 @@ pub fn strike_through<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn verbatim<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Verbatim<'s>> { let text_markup_string_specialized = text_markup_string("="); @@ -139,7 +139,7 @@ pub fn verbatim<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn code<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Code<'s>> { let text_markup_string_specialized = text_markup_string("~"); @@ -165,7 +165,7 @@ fn text_markup_object( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _text_markup_object<'r, 's, 'x>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, marker_symbol: &'x str, ) -> Res, Vec>> { @@ -216,7 +216,7 @@ fn text_markup_string( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _text_markup_string<'r, 's, 'x>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, marker_symbol: &'x str, ) -> Res, OrgSource<'s>> { @@ -257,7 +257,7 @@ fn _text_markup_string<'r, 's, 'x>( } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +pub fn pre<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let preceding_character = input.get_preceding_character(); match preceding_character { // If None, we are at the start of the file which is technically the beginning of a line. @@ -274,7 +274,7 @@ pub fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res, ()> { +pub fn post<'r, 's>(_context: RefContext<'_, 'r, 's>, input: OrgSource<'s>) -> Res, ()> { let (remaining, _) = alt((recognize(one_of(" \r\n\t-.,;:!?')}[\"")), line_ending))(input)?; Ok((remaining, ())) } @@ -290,7 +290,7 @@ fn text_markup_end( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _text_markup_end<'r, 's, 'x>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, marker_symbol: &'x str, ) -> Res, OrgSource<'s>> { @@ -307,7 +307,7 @@ impl<'x> RematchObject<'x> for Bold<'x> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn rematch_object<'r, 's>( &'x self, - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Object<'s>> { let (remaining, children) = @@ -325,7 +325,7 @@ impl<'x> RematchObject<'x> for Bold<'x> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn _rematch_text_markup_object<'r, 's, 'x>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, marker_symbol: &'static str, original_match_children: &'x Vec>, diff --git a/src/parser/timestamp.rs b/src/parser/timestamp.rs index fa1e408..d80df95 100644 --- a/src/parser/timestamp.rs +++ b/src/parser/timestamp.rs @@ -24,7 +24,7 @@ use crate::types::Timestamp; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { // TODO: This would be more efficient if we didn't throw away the parse result of the first half of an active/inactive date range timestamp if the parse fails (as in, the first thing active_date_range_timestamp parses is a active_timestamp but then we throw that away if it doesn't turn out to be a full active_date_range_timestamp despite the active_timestamp parse being completely valid). I am going with the simplest/cleanest approach for the first implementation. @@ -42,7 +42,7 @@ pub fn timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn diary_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _) = tag("<%%(")(input)?; @@ -62,7 +62,7 @@ fn diary_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn sexp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -84,7 +84,7 @@ fn sexp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn sexp_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alt((tag(")>"), recognize(one_of(">\n"))))(input) @@ -92,7 +92,7 @@ fn sexp_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn active_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _) = tag("<")(input)?; @@ -126,7 +126,7 @@ fn active_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _) = tag("[")(input)?; @@ -160,7 +160,7 @@ fn inactive_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn active_date_range_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _first_timestamp) = active_timestamp(context, input)?; @@ -182,7 +182,7 @@ fn active_date_range_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn active_time_range_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _) = tag("<")(input)?; @@ -223,7 +223,7 @@ fn active_time_range_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_date_range_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _first_timestamp) = inactive_timestamp(context, input)?; @@ -245,7 +245,7 @@ fn inactive_date_range_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_time_range_timestamp<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Timestamp<'s>> { let (remaining, _) = tag("[")(input)?; @@ -286,7 +286,7 @@ fn inactive_time_range_timestamp<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn date<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _year) = verify(digit1, |year: &OrgSource<'_>| year.len() == 4)(input)?; @@ -304,7 +304,7 @@ fn date<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn dayname<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let parser_context = @@ -326,7 +326,7 @@ fn dayname<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn dayname_end<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(verify(anychar, |c| { @@ -336,7 +336,7 @@ fn dayname_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn time<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, _hour) = verify(digit1, |hour: &OrgSource<'_>| { @@ -352,7 +352,7 @@ fn time<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn time_rest<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { let (remaining, body) = recognize(verify( @@ -365,7 +365,7 @@ fn time_rest<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn active_time_rest_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alt(( @@ -380,7 +380,7 @@ fn active_time_rest_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn inactive_time_rest_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { alt(( @@ -395,7 +395,7 @@ fn inactive_time_rest_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn time_range_rest_end<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // We pop off the most recent context element to get a context tree with just the active/inactive_time_rest_end exit matcher (removing this function from the exit matcher chain) because the 2nd time in the range does not end when a "-TIME" pattern is found. @@ -407,7 +407,7 @@ fn time_range_rest_end<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn repeater<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // + for cumulative type @@ -423,7 +423,7 @@ fn repeater<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn warning_delay<'r, 's>( - _context: RefContext<'r, 's>, + _context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { // - for all type diff --git a/src/parser/util.rs b/src/parser/util.rs index 92a35ec..41539ca 100644 --- a/src/parser/util.rs +++ b/src/parser/util.rs @@ -26,7 +26,7 @@ pub const WORD_CONSTITUENT_CHARACTERS: &str = /// Check if we are below a section of the given section type regardless of depth #[allow(dead_code)] -pub fn in_section<'r, 's, 'x>(context: RefContext<'r, 's>, section_name: &'x str) -> bool { +pub fn in_section<'r, 's, 'x>(context: RefContext<'_, 'r, 's>, section_name: &'x str) -> bool { for thing in context.iter() { match thing.get_data() { ContextElement::Context(name) if *name == section_name => return true, @@ -38,7 +38,7 @@ pub fn in_section<'r, 's, 'x>(context: RefContext<'r, 's>, section_name: &'x str /// Checks if we are currently an immediate child of the given section type pub fn immediate_in_section<'r, 's, 'x>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, section_name: &'x str, ) -> bool { for thing in context.iter() { @@ -73,7 +73,7 @@ pub fn element_trailing_whitespace<'s>(input: OrgSource<'s>) -> Res( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Option>> { if exit_matcher_parser(context, input).is_err() { @@ -85,7 +85,7 @@ pub fn maybe_consume_object_trailing_whitespace_if_not_exiting<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn maybe_consume_trailing_whitespace_if_not_exiting<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Option>> { if context.should_consume_trailing_whitespace() && exit_matcher_parser(context, input).is_err() @@ -98,7 +98,7 @@ pub fn maybe_consume_trailing_whitespace_if_not_exiting<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn maybe_consume_trailing_whitespace<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, Option>> { if context.should_consume_trailing_whitespace() { @@ -147,7 +147,7 @@ pub fn non_whitespace_character(input: OrgSource<'_>) -> Res, char /// Check that we are at the start of a line #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn exit_matcher_parser<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { peek(|i| context.check_exit_matcher(i))(input) @@ -155,7 +155,7 @@ pub fn exit_matcher_parser<'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn text_until_exit<'r, 's>( - context: RefContext<'r, 's>, + context: RefContext<'_, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { recognize(verify(