Skip to content

Commit

Permalink
clippy: merge two match arms in IResult management
Browse files Browse the repository at this point in the history
The two arms has an identical body.
+ enable `clippy::match_same_arms` lint
help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
  • Loading branch information
gwen-lg committed Mar 27, 2024
1 parent 7da45c1 commit 59e4a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ impl<I: Default + Eq, O, E: fmt::Debug> IResultExt<I, O, E> for IResult<I, O, E>
}
IResult::Err(err) => match err {
nom::Err::Incomplete(_) => Err(SubError::IncompleteInput),
nom::Err::Error(err) => Err(SubError::Parse(format!("{err:?}"))),
nom::Err::Failure(err) => Err(SubError::Parse(format!("{err:?}"))),
nom::Err::Error(err) | nom::Err::Failure(err) => {
Err(SubError::Parse(format!("{err:?}")))
}
},
}
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#![deny(clippy::borrowed_box)]
#![deny(clippy::clone_on_copy)]
#![deny(clippy::doc_markdown)]
#![deny(clippy::match_same_arms)]
#![deny(clippy::missing_panics_doc)]
#![deny(clippy::missing_fields_in_debug)]
#![deny(clippy::must_use_candidate)]
Expand Down

0 comments on commit 59e4a7c

Please sign in to comment.