-
Notifications
You must be signed in to change notification settings - Fork 412
Fix clippy errors: resolve always-return-zero operations #3223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3223 +/- ##
==========================================
+ Coverage 89.69% 89.70% +0.01%
==========================================
Files 122 122
Lines 101791 101791
Branches 101791 101791
==========================================
+ Hits 91300 91313 +13
+ Misses 7791 7779 -12
+ Partials 2700 2699 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of these is that they make the code more readable. The compiler will optimize them out, so there's no harm in keeping them and it makes the code easier to scan. NAK
@dunxen What do you think? |
Agreed, I think it’s more readable the way it currently is. We should probably add a rule ignore in these places if don’t want more PRs opened for these these :) |
Ok then closing. Looks like clippy is not checked anyway in the CI checks. |
An ignore rule would be great, though, as we really should be doing clippy checks, its just not something we've historically done. Any desire to push through the clippy checks for us @Mirebella? We could start by just adding all the current clippy violations to an ignore list and checking anything left in CI, then slowly chip away at them. |
@TheBlueMatt I checked and there is already an ignore list: rust-lightning/.github/workflows/build.yml Lines 228 to 230 in 795887a
Is this what you had in mind? It already ignores (allows) the error I wanted to solve in this PR: https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op |
Ah, yea, basically, but we should also start making progress on all the clippy warnings and then expanding the deny list there. |
Fix clippy "error: this operation will always return zero".
Error described in https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op