Apply more suggestions.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user