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

Fix Rust 1.83 clippy warnings #2148

Merged
merged 6 commits into from
Nov 28, 2024
Merged

Fix Rust 1.83 clippy warnings #2148

merged 6 commits into from
Nov 28, 2024

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Nov 28, 2024

Content

This PR includes fix for the new clippy warning raised in rust 1.83 released today (27 November 2024).

The two most common warnings solved are:

  • Stronger lifetime checks: the following explicit lifetimes could be elided: 'a and elided lifetime has a name
  • Missing documentation now encompass cfg(test) gated public items:
    • This is solved mostly by changing the visibility of those items to something that's not included in the crate public api (so at most pub(crate)).
    • This solution means that dead code analysis now run against those symbols (as they were public before and public symbols are excluded).

Pre-submit checklist

  • Branch
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Closes #2147

using `cargo clippy --all-targets --all-features --fix`
…bols

by adjusting their visibility so they're at most `pub(crate)`.

Note: With rust `1.83` there's no more 'missing doc' exception for `cfg(test)`
and `pub` symbols.
Those were before marked as public so they were excluded from the dead
code analysis, but the previous commit adjusted their visibility to at
most `pub(crate)`.
@Alenar Alenar self-assigned this Nov 28, 2024
Copy link

github-actions bot commented Nov 28, 2024

Test Results

    4 files  ±0     51 suites  ±0   11m 48s ⏱️ ±0s
1 414 tests ±0  1 414 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 625 runs  ±0  1 625 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f399f24. ± Comparison against base commit e38a254.

♻️ This comment has been updated with latest results.

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

CHANGELOG.md Outdated Show resolved Hide resolved
@Alenar Alenar temporarily deployed to testing-preview November 28, 2024 16:41 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet November 28, 2024 16:41 — with GitHub Actions Inactive
* mithril-metric from `0.1.2` to `0.1.3`
* mithril-persistence from `0.2.37` to `0.2.38`
* mithril-aggregator from `0.5.115` to `0.5.116`
* mithril-common from `0.4.89` to `0.4.90`
* mithril-relay from `0.1.27` to `0.1.28`
* mithril-signer from `0.2.216` to `0.2.217`
@Alenar Alenar force-pushed the djo/2147/rust_1.83 branch from 4859520 to f399f24 Compare November 28, 2024 16:42
@Alenar Alenar temporarily deployed to testing-preview November 28, 2024 16:59 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet November 28, 2024 16:59 — with GitHub Actions Inactive
@Alenar Alenar merged commit 379fbd1 into main Nov 28, 2024
47 checks passed
@Alenar Alenar deleted the djo/2147/rust_1.83 branch November 28, 2024 17:02
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.

Fix clippy warnings with Rust 1.83.0
3 participants