Apply more suggestions.

This commit is contained in:
Tom Alexander
2023-10-16 18:29:21 -04:00
parent 4b6c717812
commit 3069711447
22 changed files with 86 additions and 114 deletions

View File

@@ -61,10 +61,10 @@ where
let (remaining, (_begin, name)) = tuple((
tag_no_case("#+begin_"),
verify(name, |name: &OrgSource<'_>| {
match Into::<&str>::into(name).to_lowercase().as_str() {
"comment" | "example" | "export" | "src" | "verse" => false,
_ => true,
}
!matches!(
Into::<&str>::into(name).to_lowercase().as_str(),
"comment" | "example" | "export" | "src" | "verse",
)
}),
))(remaining)?;
let name = Into::<&str>::into(name);
@@ -233,7 +233,7 @@ fn greater_block_body<'c, 'b, 'g, 'r, 's>(
) -> Res<OrgSource<'s>, (&'s str, Vec<Element<'s>>)> {
if in_section(context, context_name) {
return Err(nom::Err::Error(CustomError::MyError(MyError(
"Cannot nest objects of the same element".into(),
"Cannot nest objects of the same element",
))));
}
let exit_with_name = greater_block_end(name);
@@ -288,7 +288,7 @@ fn parameters<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
recognize(many_till(anychar, peek(tuple((space0, line_ending)))))(input)
}
fn greater_block_end<'c>(name: &'c str) -> impl ContextMatcher + 'c {
fn greater_block_end(name: &str) -> impl ContextMatcher + '_ {
move |context, input: OrgSource<'_>| _greater_block_end(context, input, name)
}