Enable a ton of pedantic clippy lints#228
Merged
delta1 merged 28 commits intoElementsProject:masterfrom Jun 27, 2025
Merged
Conversation
Convert a bool to 64 with `from` rather than a manual conversion.
This one is about casts that are totally unnecessary.
As a matter of style, I don't like Default::default because it creates an object without specifying what type it has.
This one has a huge diff, and there's still a ton of work to do to clean up these docs, but it should be a big improvement.
This one is a bit silly -- it complains if you do `if !x {} else {}`
because it would supposedly be simpler to swap the if and the else.
In fact, everywhere it triggers in this crate it *would* be an
improvement, or at least neutral. So turn it on. In some cases we are
using if-statements where we could instead use matches.
Just style.
Just one test. Arguably I should've just whitelisted it. BUt I cleaned it up.
There is a `map_or` method that encapsulates the `.map().unwrap_or()` pattern. Use it to reduce the number of function calls the reader has to read.
Better to be explicit.
This has some API-breaking changes but they're worthwhile (and eliminate a bunch of clones even in this codebase).
Essentially just a style thing; I think it's nicer to be explicit about what type we're calling methods on, and I think it's nicer to avoid the closure syntax when we can.
I'm not convinced that any of these are really necessary, but they don't hurt and might save somebody a bug.
Just style, and apologies for the annoying-to-review diff that moves logic around. But the result is more consistent and (I think) better.
Neat! I didn't know about this syntax. Simplifies a lot of opcode matching.
I think this is a style improvement.
Member
Author
|
cc @canndrew can you review this? |
|
ACK 57c81d3 |
delta1
approved these changes
Jun 27, 2025
Member
|
@apoelstra does the readme MSRV need to be updated? Can also be done in a follow-up |
Member
Author
|
@delta1 Ah, yep. Will do in a followup. |
Member
Author
|
@delta1 please use the merge script when merging into this repo |
Member
|
@apoelstra sorry! Will do. |
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.
There are a ton of commits here but they're (mostly) all small and mechanical.