Fix some clippy errors that didn't appear on my host version of clippy.
Some checks failed
clippy Build clippy has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander 2023-10-16 19:43:15 -04:00
parent e4d9c5f467
commit e2d55e13d3
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 6 additions and 11 deletions

View File

@ -43,13 +43,8 @@ where
let value_start = remaining;
start_of_line(remaining)?;
let (remaining, _leading_whitespace) = space0(remaining)?;
let (remaining, (_opening, name, _open_close_brace, _ws, _line_ending)) = tuple((
tag_no_case(r#"\begin{"#),
name,
tag("}"),
space0,
line_ending,
))(remaining)?;
let (remaining, (_opening, name, _open_close_brace, _ws, _line_ending)) =
tuple((tag_no_case(r"\begin{"), name, tag("}"), space0, line_ending))(remaining)?;
let latex_environment_end_specialized = latex_environment_end(name.into());
let parser_context = ContextElement::ExitMatcherNode(ExitMatcherNode {
@ -127,7 +122,7 @@ fn _latex_environment_end<'b, 'g, 'r, 's, 'c>(
start_of_line(input)?;
let (remaining, _leading_whitespace) = space0(input)?;
let (remaining, (_begin, _name, _close_brace, _ws, _line_ending)) = tuple((
tag_no_case(r#"\end{"#),
tag_no_case(r"\end{"),
tag_no_case(current_name_lower),
tag("}"),
space0,

View File

@ -21,7 +21,7 @@ pub(crate) fn line_break<'b, 'g, 'r, 's>(
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, LineBreak<'s>> {
let (remaining, _) = pre(context, input)?;
let (remaining, _) = tag(r#"\\"#)(remaining)?;
let (remaining, _) = tag(r"\\")(remaining)?;
let (remaining, _) = recognize(many0(one_of(" \t")))(remaining)?;
let (remaining, _) = line_ending(remaining)?;
let source = get_consumed(input, remaining);

View File

@ -175,7 +175,7 @@ fn script_alphanum<'b, 'g, 'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn script_alphanum_character<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
recognize(verify(anychar, |c| {
c.is_alphanumeric() || r#",.\"#.contains(*c)
c.is_alphanumeric() || r",.\".contains(*c)
}))(input)
}
@ -183,7 +183,7 @@ fn script_alphanum_character<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, Org
fn end_script_alphanum_character<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
let (remaining, final_char) = recognize(verify(anychar, |c| c.is_alphanumeric()))(input)?;
peek(tuple((
take_while(|c| r#",.\"#.contains(c)),
take_while(|c| r",.\".contains(c)),
not(script_alphanum_character),
)))(remaining)?;
Ok((remaining, final_char))