Add and Apply rust-bitcoin's Lints#226
Open
luisschwab wants to merge 1 commit into
Open
Conversation
luisschwab
force-pushed
the
chore/add-lints
branch
from
July 6, 2026 23:40
47bef2f to
f9ae425
Compare
luisschwab
force-pushed
the
chore/add-lints
branch
from
July 8, 2026 15:00
f9ae425 to
80feb72
Compare
Member
Author
|
ping @oleonardolima |
Comment on lines
187
to
+201
| @@ -194,7 +196,9 @@ pub fn convert_fee_rate(target_blocks: usize, estimates: HashMap<u16, FeeRate>) | |||
| } | |||
|
|
|||
| /// Convert a [`HashMap`] of fee estimates expressed as sat/vB ([`f64`]) into [`FeeRate`]s. | |||
| pub fn sat_per_vbyte_to_feerate(estimates: HashMap<u16, f64>) -> HashMap<u16, FeeRate> { | |||
| pub fn sat_per_vbyte_to_feerate<S: BuildHasher>( | |||
| estimates: HashMap<u16, f64, S>, | |||
| ) -> HashMap<u16, FeeRate> { | |||
Collaborator
There was a problem hiding this comment.
Is this really needed ?
Member
Author
There was a problem hiding this comment.
The implicit_hasher = "warn" lint enforces this. It doesn't really make that big of a difference, but allows the caller to pass a HashMap built with any BuildHasher implementation instead of forcing the default one.
Comment on lines
+101
to
+103
| # Copied over from `rust-bitcoin` | ||
| [lints.clippy] | ||
| # Exclude lints we don't think are valuable. |
Collaborator
There was a problem hiding this comment.
Do we really need all of them ? Can't we have these in a clippy.toml instead ?
Member
Author
There was a problem hiding this comment.
It's good for code quality, these have been curated by the rust-bitcoin project over a long time, and they're sensible in my opinion.
I'd rather keep them on Cargo.toml.
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.
This PR adds and applies all of
rust-bitcoin'sclippylints and a few usefulrustlints.