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 a lint for .repeat(1) #5773

Merged
merged 4 commits into from
Jul 14, 2020
Merged

Add a lint for .repeat(1) #5773

merged 4 commits into from
Jul 14, 2020

Conversation

giraffate
Copy link
Contributor

@giraffate giraffate commented Jul 7, 2020

changelog: New lint repeat_once

fix #3028.

@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 Jul 7, 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.

LGTM overall. 2 minor things, that will simplify the impl.

clippy_lints/src/repeat_once.rs Outdated Show resolved Hide resolved
clippy_lints/src/repeat_once.rs Outdated Show resolved Hide resolved
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jul 13, 2020
Use `constant_context`, `.is_str()` and `builtin_index()` to simplify.
@giraffate
Copy link
Contributor Author

@flip1995 Thanks for your review. I fixed it.

@flip1995
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 14, 2020

📌 Commit b409103 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Jul 14, 2020

⌛ Testing commit b409103 with merge 12df638...

@bors
Copy link
Collaborator

bors commented Jul 14, 2020

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

@bors bors merged commit 12df638 into rust-lang:master Jul 14, 2020
@giraffate giraffate deleted the repeat_once branch July 14, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint against String.repeat(1)
5 participants