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: #8831

Closed
wants to merge 1 commit into from
Closed

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Nov 4, 2020

manual_range_contains
needless_lifetimes

@rust-highfive
Copy link

r? @ehuss

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2020
src/cargo/util/config/value.rs Outdated Show resolved Hide resolved
src/cargo/util/workspace.rs Outdated Show resolved Hide resolved
manual_range_contains
needless_lifetimes
@@ -298,11 +298,11 @@ impl<'a> Iterator for Tokenizer<'a> {
}

fn is_ident_start(ch: char) -> bool {
ch == '_' || ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')
Copy link
Member

Choose a reason for hiding this comment

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

You could use matches! here as well.

@ehuss
Copy link
Contributor

ehuss commented Nov 7, 2020

Thanks! I appreciate trying to make small code cleanups (I post them myself sometimes!). However, I'm not sure either of these changes really makes the code more readable for me. The contains change seems to express the same thing, just in a different way. The "needless lifetimes" doesn't seem so needless, since it still needs to include '_, and now it is not clear what that '_ lifetime is referring to. I somehow now need to run the lifetime inference algorithm in my head to know what it means, which is not something I'm capable of doing.

I won't oppose if someone else on the team wants to merge this if they think it is an improvement, but I personally would prefer to keep these as they were.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants