659: Fix clippy error to add clippy job on Ci r=Kerollmops a=unvalley

## Related PR
This PR is for #673 

## What does this PR do?
- ~~add `Run Clippy` job to CI (rust.yml)~~
- apply `cargo clippy --fix` command
- fix some `cargo clippy` error manually (but warnings still remain on tests)

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?


Co-authored-by: unvalley <kirohi.code@gmail.com>
Co-authored-by: unvalley <38400669+unvalley@users.noreply.github.com>
This commit is contained in:
bors[bot] 2022-11-03 15:24:38 +00:00 committed by GitHub
commit 6add470805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 108 additions and 105 deletions

View file

@ -168,7 +168,7 @@ fn ws<'a, O>(inner: impl FnMut(Span<'a>) -> IResult<O>) -> impl FnMut(Span<'a>)
}
/// value_list = (value ("," value)* ","?)?
fn parse_value_list<'a>(input: Span<'a>) -> IResult<Vec<Token<'a>>> {
fn parse_value_list(input: Span) -> IResult<Vec<Token>> {
let (input, first_value) = opt(parse_value)(input)?;
if let Some(first_value) = first_value {
let value_list_el_parser = preceded(ws(tag(",")), parse_value);
@ -335,13 +335,11 @@ fn parse_error_reserved_keyword(input: Span) -> IResult<FilterCondition> {
Ok(result) => Ok(result),
Err(nom::Err::Error(inner) | nom::Err::Failure(inner)) => match inner.kind() {
ErrorKind::ExpectedValue(ExpectedValueKind::ReservedKeyword) => {
return Err(nom::Err::Failure(inner));
Err(nom::Err::Failure(inner))
}
_ => return Err(nom::Err::Error(inner)),
_ => Err(nom::Err::Error(inner)),
},
Err(e) => {
return Err(e);
}
Err(e) => Err(e),
}
}
@ -401,7 +399,7 @@ pub mod tests {
fn parse() {
use FilterCondition as Fc;
fn p<'a>(s: &'a str) -> impl std::fmt::Display + 'a {
fn p(s: &str) -> impl std::fmt::Display + '_ {
Fc::parse(s).unwrap().unwrap()
}
@ -494,7 +492,7 @@ pub mod tests {
fn error() {
use FilterCondition as Fc;
fn p<'a>(s: &'a str) -> impl std::fmt::Display + 'a {
fn p(s: &str) -> impl std::fmt::Display + '_ {
Fc::parse(s).unwrap_err().to_string()
}