-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
clippy: runtime lints #34630
Merged
Merged
clippy: runtime lints #34630
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> runtime/src/accounts/mod.rs:483:82 | 483 | let min_balance = match get_system_account_kind(payer_account).ok_or_else(|| { | __________________________________________________________________________________^ 484 | | error_counters.invalid_account_for_fee += 1; 485 | | TransactionError::InvalidAccountForFee 486 | | })? { | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions = note: `#[warn(clippy::blocks_in_conditions)]` on by default warning: this `let...else` may be rewritten with the `?` operator --> runtime/src/bank.rs:3093:21 | 3093 | / let Some(vote_account) = get_vote_account(&vote_pubkey) else { 3094 | | return None; 3095 | | }; | |______________________^ help: replace it with: `let vote_account = get_vote_account(&vote_pubkey)?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark = note: `#[warn(clippy::question_mark)]` on by default warning: this `let...else` may be rewritten with the `?` operator --> runtime/src/bank.rs:4778:17 | 4778 | / let Some((_, account)) = accounts.get(i) else { 4779 | | return None; 4780 | | }; | |__________________^ help: replace it with: `let (_, account) = accounts.get(i)?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark Checking solana-bench-streamer v1.18.0 (/Users/brooks/src/solana/bench-streamer) warning: `solana-runtime` (lib) generated 3 warnings ```
brooksprumo
force-pushed
the
clippy/runtime
branch
from
January 3, 2024 00:57
bf3bb18
to
523d122
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #34630 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 824 824
Lines 222260 222256 -4
=======================================
+ Hits 181893 181894 +1
+ Misses 40367 40362 -5 |
brooksprumo
added
the
automerge
Merge this Pull Request automatically once CI passes
label
Jan 3, 2024
HaoranYi
approved these changes
Jan 3, 2024
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.
lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
There are new nightly clippy lints in the runtime crate. Refer to #34626 for more information.
Summary of Changes
Fix 'em.