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

Improved the code with clippy 1.80 #6569

Merged
merged 1 commit into from
May 18, 2024
Merged

Conversation

41Leahcim
Copy link
Contributor

I improved the code with clippy 1.80 (nightly 2024-05-16). The code compiles, doesn't cause any warnings with clippy 1.77 and 1.80, and all tests succeed. I know you don't like it when people use a newer version of clippy, let alone the current nightly version, but I wanted to contribute and I don't know enough to contribute more.

Motivation

I'm trying to improve the code of libraries I use and I use Tokio a lot.

Solution

Replaced cmp::max(2, cmp::min(...)) with clamp, removed usize imports, replaced std::usize:: and std::u32:: with usize:: and u32:: respectively, moved parentheses to put the future into the blackbox instead of the unit value.

@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 labels May 17, 2024
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks. Can you please update our ci configuration?

rust_clippy: '1.77'

@Darksonn Darksonn added the A-tokio Area: The main tokio crate label May 17, 2024
@41Leahcim
Copy link
Contributor Author

Do you want me to update it to the latest nightly, beta or stable version?

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Oh, I did not realize that 1.80 was not a stable release. In that case, let's keep it as-is.

@Darksonn Darksonn merged commit daa8901 into tokio-rs:master May 18, 2024
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants