Fix clippy lints in integration_test#261
Merged
tcharding merged 7 commits intorust-bitcoin:masterfrom Jun 24, 2025
Merged
Conversation
Member
|
All the changes that remove Its ok this time but doing all the lints in a single patch costs the reviewer brain space for the benefit of the dev. Review time is always more valuable than dev time in open source projects. In this case its no problem but just a thing to keep in mind as you advance in open source. |
Ord::max already returns a u32, casting to u32 is redundant. Remove `as u32` on the u32 value.
Lint error due to unnecessary `== false`, replace it with `!`
Some functions that take a value were passed a reference. Change them all to pass the value.
The for loop can be written more simply. Change it to iterate over `.values()`.
There is a conversion of sats to btc that uses groupings of 100_000_000. Allow this inconsistent digit grouping to aid in readability and remove the lint error.
The assert checking if the key is in the map can be written more simply. Use the `contains_key` function to make the code clearer and remove the lint error.
Two cases of rpcs that return null but were assigned to a variable `_` caused a lint error. Declare the variable as a unit type for the return value of rpcs that return null.
3cedc14 to
449f319
Compare
Collaborator
Author
|
I have split it into individual commits for each type of lint error. The only change is the last patch that specifically assigns the return of the rpcs that return null to a unit type variable, rather than just dropping them. |
tcharding
approved these changes
Jun 24, 2025
blaze-smith470pm
added a commit
to blaze-smith470pm/corepc
that referenced
this pull request
Sep 26, 2025
449f319e408f77c93cf2a90acfdf645d9b7d4787 Add let _: () = ... to rpc calls that return null (Jamil Lambert, PhD)
1810527de409d8c99d877a48115fbdc489e86fcc Simplify assert on map key (Jamil Lambert, PhD)
acd9332afb7a13104474bcd96bf79abec2905264 Allow inconsistent digit grouping (Jamil Lambert, PhD)
b5777a78250727f6f6297ab7c832ff9f27dc1782 Refactor for loop declaration (Jamil Lambert, PhD)
aabdaa3b644245eb4cb6beb6b572efdf63a1eb60 Pass value instead of reference (Jamil Lambert, PhD)
71824cd6f02db2de45139abb476b677f6ed82ff4 change == false to ! (Jamil Lambert, PhD)
fd8fa74065a11ae752a2fad555ccdaba1349523f Remove redundant as u32 (Jamil Lambert, PhD)
Pull request description:
A new script to lint the integration tests is being added in #258.
Run the script and fix all the lint errors.
ACKs for top commit:
tcharding:
ACK 449f319e408f77c93cf2a90acfdf645d9b7d4787
Tree-SHA512: 65f3429d227b05e4e54e252afb8b406100e743c1048fa05b86455d7020815b4966b3b1a2b291fb0c2064022b01dc90aed9a6f054a78b1840c81865bf42776adb
This file contains hidden or 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
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.
A new script to lint the integration tests is being added in #258.
Run the script and fix all the lint errors.