Remove unnecessary context from some util functions.
All checks were successful
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded

This commit is contained in:
Tom Alexander
2023-08-24 19:29:00 -04:00
parent e5224cda63
commit cf37bc4111
20 changed files with 38 additions and 55 deletions

View File

@@ -39,7 +39,7 @@ pub fn footnote_definition<'r, 's>(
"Cannot nest objects of the same element".into(),
))));
}
start_of_line(context, input)?;
start_of_line(input)?;
// Cannot be indented.
let (remaining, (_lead_in, lbl, _lead_out, _ws)) =
tuple((tag_no_case("[fn:"), label, tag("]"), space0))(input)?;
@@ -80,7 +80,6 @@ fn footnote_definition_end<'r, 's>(
context: Context<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
let start_of_line_matcher = parser_with_context!(start_of_line)(context);
let allow_nesting_context =
context.with_additional_node(ContextElement::Context("allow nesting footnotes"));
let footnote_definition_matcher = parser_with_context!(footnote_definition)(
@@ -98,7 +97,7 @@ fn footnote_definition_end<'r, 's>(
footnote_definition_matcher,
))),
recognize(tuple((
start_of_line_matcher,
start_of_line,
verify(many1(blank_line), |lines: &Vec<OrgSource<'_>>| {
lines.len() >= 2
}),