Skip to content

Fix clippy lints with no-default-features#5105

Merged
apoelstra merged 4 commits intorust-bitcoin:masterfrom
jamillambert:0810-clippy-lints
Oct 10, 2025
Merged

Fix clippy lints with no-default-features#5105
apoelstra merged 4 commits intorust-bitcoin:masterfrom
jamillambert:0810-clippy-lints

Conversation

@jamillambert
Copy link
Copy Markdown
Contributor

In preparation for adding crate specific clippy runs in CI with no-default-features, fix all the current lint errors when running it locally in each crate.

There is one clippy error locally in primitives from an unused import (only used with alloc), but it is fixed in #4998.

Clippy lint with no-default features.

Make the suggested change to fix the lint.
Fix the clippy lints for the use of an explicit lifetime.
@github-actions github-actions bot added C-bitcoin PRs modifying the bitcoin crate C-hashes PRs modifying the hashes crate C-consensus_encoding PRs modifying the consensus-encoding crate C-primitives labels Oct 8, 2025
@github-actions github-actions bot added the test label Oct 8, 2025
@tcharding
Copy link
Copy Markdown
Member

In 01feef5 would be better IMO to feature gate on the same feature that the usage is feature gated on.

@tcharding
Copy link
Copy Markdown
Member

ACK everything else, reviewed: cc0e022

The structs are only used with `alloc` or `std`.

Feature gate the structs, their impls and the associated import with
`alloc`, which is already a dependency of `std`.
Clippy lint for a test const that is only used in an alloc feature gated
test.

Feature gate the cost as well.
@jamillambert
Copy link
Copy Markdown
Contributor Author

Feature gated the structs and associated implements and import.

Copy link
Copy Markdown
Member

@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.

ACK a4be941; successfully ran local tests

Copy link
Copy Markdown
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK a4be941

@apoelstra apoelstra merged commit 85ba847 into rust-bitcoin:master Oct 10, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bitcoin PRs modifying the bitcoin crate C-consensus_encoding PRs modifying the consensus-encoding crate C-hashes PRs modifying the hashes crate C-primitives test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants