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

Add lint for comparing to empty slices instead of using .is_empty() #6226

Merged
merged 8 commits into from
Oct 29, 2020

Conversation

Urcra
Copy link
Contributor

@Urcra Urcra commented Oct 26, 2020

Hey first time making a clippy lint

I added the implementation of the lint the len_zero since it shared a lot of the code, I would otherwise have to rewrite. Just tell me if the lint should use it's own file instead

changelog: Add lint for comparing to empty slices

Fixes #6217

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 26, 2020
@Urcra Urcra changed the title [WIP] Add lint for comparing to empty slices instead of using .is_empty() Add lint for comparing to empty slices instead of using .is_empty() Oct 26, 2020
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

Thanks for your (almost perfect) first contribution and welcome to Clippy! <3

clippy_lints/src/len_zero.rs Outdated Show resolved Hide resolved
@Urcra
Copy link
Contributor Author

Urcra commented Oct 29, 2020

Thanks for your (almost perfect) first contribution and welcome to Clippy! <3

Thanks, and thank you for the review

@flip1995
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 29, 2020

📌 Commit e3de544 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Oct 29, 2020

⌛ Testing commit e3de544 with merge e1a2845...

@bors
Copy link
Contributor

bors commented Oct 29, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing e1a2845 to master...

@bors bors merged commit e1a2845 into rust-lang:master Oct 29, 2020
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.

Use is_empty instead of comparing to empty slice/str
4 participants