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

Fix clippy warnings #505

Merged
merged 3 commits into from
Jan 4, 2021
Merged

Fix clippy warnings #505

merged 3 commits into from
Jan 4, 2021

Conversation

davidpdrsn
Copy link
Member

Thought I might as well fix the clippy warnings. Feel free to close this if you don't want the git churn.

tower/src/balance/p2c/service.rs Outdated Show resolved Hide resolved
@hawkw
Copy link
Member

hawkw commented Jan 4, 2021

One other note: if we're going to start caring about clippy lints (which I think we ought to), I think we should probably add a Clippy check step on CI. This will stop us from going and adding new code that clippy doesn't like, and having to do another big "fix clippy warnings" PR to make them go away. We can do that separately, though.


/// Returns whether or not the balancer is empty.
pub fn is_empty(&self) -> bool {
self.len() == 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would expect this to trigger clippy. Should this be:

Suggested change
self.len() == 0
self.services.is_empty()

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if ReadyCache actually has an is_empty, but it probably should if it does not...

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh good catch. Fixed in 5dc6044

@hawkw hawkw merged commit 3bdaae9 into tower-rs:master Jan 4, 2021
@davidpdrsn davidpdrsn deleted the fix-clippy-warnings branch January 4, 2021 22:55
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.

3 participants