Skip to content

another round of new clippy lints #128

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

Merged
merged 7 commits into from
May 7, 2025

Conversation

apoelstra
Copy link
Contributor

Mostly style. Does find one real issue with our docs.

apoelstra added 7 commits May 5, 2025 14:14
This would warn about some subset of index-related panics. In recent
nightlies this has been subsumed by the `indexing_slicing` lint which
lints on all array indexing. This is pretty cool but waay overkill.
This is mostly a style thing.
As a matter of style, we should always have items (structs, fns, etc)
first in a block before any real code. This is because it's easy for the
real code to be missed if it's interspersed with items.
Ok, this one might be controversial :). Purely stylistic. Uses the new
`let...else` syntax. Saves a line of code.
Style.

This one looks a bit scary because it's not obvious what the right order
of parameters to `map_or` is, but actually it's fine -- the first
parameter is an object and the second is a function, and they only look
the same because of Rust's pattern syntax.
@apoelstra apoelstra force-pushed the 2025-05--clippy-2 branch from 47f039b to 0fc8f4a Compare May 5, 2025 14:40
Copy link
Contributor Author

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 0fc8f4a successfully ran local tests

Copy link
Collaborator

@uncomputable uncomputable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 0fc8f4a

@apoelstra apoelstra merged commit b810cc2 into BlockstreamResearch:master May 7, 2025
14 checks passed
@apoelstra apoelstra deleted the 2025-05--clippy-2 branch May 7, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants