Chore: silence clippy closure in match warning #267
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clippy is complaining about closures in match conditions.
https://rust-lang.github.io/rust-clippy/master/index.html#/blocks_in_conditions
I think the claim that this style "makes it hard to read" is subjective. I personally find these to be easily readable and I think it would be okay to just silence this warning.
These are the 2 offending blocks:
in misc.rs:
in system.rs
I think find clippy is a bit heavy-handed, we've silenced quite a few things on litheumcore:
cargo clippy -- -A clippy::new_without_default -A clippy::too_many_arguments -A clippy::borrowed_box -A clippy::redundant_pattern_matching -A clippy::needless_bool -A clippy::or_fun_call -A clippy::len_without_is_empty -A clippy::identity_op -A clippy::collapsible_else_if -A clippy::unnecessary_fold -A clippy::map_flatten