Skip to content

Reducing even eliminating all clippy warning #3802

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

Closed
linyihai opened this issue Nov 30, 2024 · 3 comments
Closed

Reducing even eliminating all clippy warning #3802

linyihai opened this issue Nov 30, 2024 · 3 comments
Labels
C-refactor Category: refactor. This would improve the clarity of internal code.

Comments

@linyihai
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Running clippy cmd, current workspace generate serval warnings

cargo clippy --workspace --all-targets --no-deps -- -D warnings

output is

...

error: non-binding `let` on a future
   --> src/client/dispatch.rs:455:9
    |, 
455 |         let _ = tx.try_send(Custom(3)).unwrap();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider awaiting the future or dropping explicitly with `std::mem::drop`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future

error: could not compile `hyper` (lib test) due to 49 previous errors

Describe the solution you'd like

  • Some of the more obvious fixes and can be automatically adopted, can be repaired
  • Something that requires a little bit of thinking about how to improve, like defining types for complex expressions, like Poll<Option<crate::Result<(MessageHead<T::Incoming>, DecodedLength, Wants)>>>,
  • Add clippy CI workflow

Describe alternatives you've considered

Additional context

@linyihai linyihai added the C-feature Category: feature. This is adding a new feature. label Nov 30, 2024
@linyihai
Copy link
Contributor Author

I would love to reduce clippy error prompts :)

@seanmonstar
Copy link
Member

Some of the things clippy finds are worth fixing! But just enough things I disagree with that I therefore don't automatically run clippy, nor do I keep it in a CI job.

So, if you see some things that seem like obvious wins, those are welcome in a PR! I might comment on some of them that I disagree with what clippy recommends, just so you know ahead of time :)

@seanmonstar seanmonstar added C-refactor Category: refactor. This would improve the clarity of internal code. and removed C-feature Category: feature. This is adding a new feature. labels Dec 2, 2024
@linyihai
Copy link
Contributor Author

linyihai commented Dec 9, 2024

Some of the things clippy finds are worth fixing! But just enough things I disagree with that I therefore don't automatically run clippy, nor do I keep it in a CI job.

So, if you see some things that seem like obvious wins, those are welcome in a PR! I might comment on some of them that I disagree with what clippy recommends, just so you know ahead of time :)

Thanks for you clarification.

@linyihai linyihai closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: refactor. This would improve the clarity of internal code.
Projects
None yet
Development

No branches or pull requests

2 participants