Skip to content
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

clippy: type_complexity #4396

Merged

Conversation

brooksprumo
Copy link

Problem

New clippy lints when upgrading to rust 1.84.0.

warning: very complex type used. Consider factoring parts into `type` definitions
   --> ledger/src/blockstore.rs:679:10
    |
679 |     ) -> Result<impl Iterator<Item = (Box<[u8]>, Box<[u8]>)> + '_> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
    = note: `#[warn(clippy::type_complexity)]` on by default

warning: very complex type used. Consider factoring parts into `type` definitions
   --> ledger/src/blockstore.rs:689:10
    |
689 |     ) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

warning: very complex type used. Consider factoring parts into `type` definitions
   --> ledger/src/blockstore.rs:701:10
    |
701 |     ) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Summary of Changes

Resolve the lints by using the suggestions from clippy and checking the code.

Partially fixes #4380

@@ -673,6 +673,7 @@ impl Blockstore {
}

#[cfg(feature = "dev-context-only-utils")]
#[allow(clippy::type_complexity)]
Copy link
Author

Choose a reason for hiding this comment

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

If you would prefer an alternate solution (e.g. creating a proper type to return here), please feel free to push it to this PR.

@brooksprumo brooksprumo marked this pull request as ready for review January 10, 2025 16:38
@brooksprumo brooksprumo requested review from cpubot and steviez January 10, 2025 16:38
@brooksprumo brooksprumo added the automerge automerge Merge this Pull Request automatically once CI passes label Jan 10, 2025
@mergify mergify bot merged commit 03499e7 into anza-xyz:master Jan 10, 2025
41 checks passed
@brooksprumo brooksprumo deleted the rust-1.84.0/clippy/type_complexity branch January 10, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New clippy lints in Rust 1.84.0
2 participants