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 #4727

Merged
merged 1 commit into from
May 31, 2022
Merged

chore: fix clippy warnings #4727

merged 1 commit into from
May 31, 2022

Conversation

Darksonn
Copy link
Contributor

This fixes the following clippy warnings. (They don't appear in CI because CI uses an older clippy.)

warning: this expression borrows a value the compiler would automatically borrow
  --> tokio/src/future/poll_fn.rs:38:9
   |
38 |         (&mut self.f)(cx)
   |         ^^^^^^^^^^^^^ help: change this to: `self.f`
   |
   = note: `#[warn(clippy::needless_borrow)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: methods called `is_*` usually take `self` by reference or no `self`
  --> tokio/src/io/util/vec_with_initialized.rs:67:28
   |
67 |     pub(crate) fn is_empty(&mut self) -> bool {
   |                            ^^^^^^^^^
   |
   = note: `#[warn(clippy::wrong_self_convention)]` on by default
   = help: consider choosing a less ambiguous name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention

warning: unnecessary use of `to_vec`
   --> tokio/src/net/addr.rs:148:20
    |
148 |         let iter = self.to_vec().into_iter();
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.iter().copied()`
    |
    = note: `#[warn(clippy::unnecessary_to_owned)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned

@Darksonn Darksonn added the A-tokio Area: The main tokio crate label May 30, 2022
@Darksonn Darksonn requested a review from hawkw May 30, 2022 16:00
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

looks good to me!

@Darksonn Darksonn merged commit f948cd7 into master May 31, 2022
@Darksonn Darksonn deleted the alice/fix-clippy-warnings branch May 31, 2022 18:26
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants