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

refactor(clippy): Reduce some Clippy warnings #3805

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

linyihai
Copy link
Contributor

@linyihai linyihai commented Dec 3, 2024

What this PR want to do

Tried to complete #3802 as well as possible.

This PR wants to reduce some Clippy warnings that worth fixing. Almost all of the changes are based on clippy prompts. And passed the MSRV 1.63 test.

Some of the warnings have not changed, mainly based on Clippy's false positives, and some clippy rules are newer than the current MSRV 1.63.

How to test and review

Needs downgrade some crate versions to run on MSRV 1.63.

cargo update tokio --precise 1.38.1 
cargo update tokio-util --precise 0.7.11
cargo update hashbrown --precise 0.15.0
cargo update regex --precise 1.9.6
cargo update async-stream --precise 0.3.5
cargo update tokio-stream --precise 0.1.15

Run cargo +1.63-x86_64-unknown-linux-gnu clippy --workspace --no-deps --all-targets --features="full" -- -D warnings
The warnings/error reduces to 7.

@linyihai linyihai force-pushed the clippy branch 2 times, most recently from 4ea0be0 to 9dc5525 Compare December 3, 2024 08:06
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Thanks, several of these are fine changes. I commented inline on the ones I think clippy is wrong about.

src/client/conn/http1.rs Outdated Show resolved Hide resolved
src/proto/h1/role.rs Outdated Show resolved Hide resolved
src/server/conn/http1.rs Outdated Show resolved Hide resolved
tests/client.rs Outdated Show resolved Hide resolved
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Perfect, good work, thank you!

@seanmonstar seanmonstar merged commit 0bd4adf into hyperium:master Dec 6, 2024
22 checks passed
@linyihai linyihai deleted the clippy branch December 9, 2024 02:07
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.

2 participants