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

chore: fix clippy warnings #7136

Closed
wants to merge 2 commits into from
Closed

chore: fix clippy warnings #7136

wants to merge 2 commits into from

Conversation

rex4539
Copy link

@rex4539 rex4539 commented Feb 1, 2025

No description provided.

@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR labels Feb 1, 2025
@Darksonn Darksonn added the A-ci Area: The continuous integration setup label Feb 1, 2025
@Darksonn
Copy link
Contributor

Darksonn commented Feb 1, 2025

Which clippy warnings is this fixing? We already check for some clippy warnings based on this configuration:

rust_clippy: '1.77'

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_clippy }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_clippy }}
components: clippy
- uses: Swatinem/rust-cache@v2
# Run clippy
- name: "clippy --all"
run: cargo clippy --all --tests --all-features --no-deps

@rex4539 rex4539 force-pushed the clippy branch 6 times, most recently from a9b337e to 84ca1e0 Compare February 1, 2025 17:30
@rex4539
Copy link
Author

rex4539 commented Feb 1, 2025

I ran cargo clippy --workspace --all-features and got numerous warnings, which I fixed.

tokio-util/src/net/mod.rs Outdated Show resolved Hide resolved
@Darksonn
Copy link
Contributor

Darksonn commented Feb 5, 2025

If you make Tokio lint-free under a newer version of clippy than the one we check for right now, then please update the version number in the .github/ci folder so that it stays lint free under the new version.

@github-actions github-actions bot removed R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR labels Feb 5, 2025
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@rex4539 rex4539 force-pushed the clippy branch 2 times, most recently from 805be94 to 55bd9e5 Compare February 5, 2025 15:17
@rex4539
Copy link
Author

rex4539 commented Feb 5, 2025

How do you want to handle this case?

error: the following explicit lifetimes could be elided: 'a
  --> tokio/tests/tcp_accept.rs:57:6
   |
57 | impl<'a> Stream for TrackPolls<'a> {
   |      ^^                        ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
   |
57 - impl<'a> Stream for TrackPolls<'a> {
57 + impl Stream for TrackPolls<'_> {
   |

Fix just this one case?

tokio-util/src/time/wheel/level.rs Show resolved Hide resolved
tokio-util/src/time/wheel/level.rs Outdated Show resolved Hide resolved
tokio/src/net/mod.rs Outdated Show resolved Hide resolved
@Darksonn
Copy link
Contributor

Darksonn commented Feb 5, 2025

For TrackPolls you can apply the fix.

@rex4539 rex4539 force-pushed the clippy branch 2 times, most recently from 1558c0d to 4c1ae25 Compare February 5, 2025 15:41
@rex4539 rex4539 force-pushed the clippy branch 15 times, most recently from 6ce8643 to e957a60 Compare February 5, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: The continuous integration setup R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants