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

Replace some std::iter::repeat with str::repeat #85538

Merged
merged 1 commit into from
Jun 20, 2021

Conversation

wooster0
Copy link
Contributor

I noticed that there were some instances where std::iter::repeat would be used to repeat a string or a char to take a specific count of it and then collect it into a String when str::repeat is actually much faster and better for that.

See also: rust-lang/rust-clippy#7260.

@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 May 21, 2021
@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented May 26, 2021

📌 Commit edd38a936d1dec1d3fe5c4857185ccd21c44d1b3 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 26, 2021
@Mark-Simulacrum
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 26, 2021
@Mark-Simulacrum
Copy link
Member

Please squash out the merge(?) commit.

@wooster0
Copy link
Contributor Author

Done. I just realized that the changes I made in src/tools/clippy/clippy_lints/* were useless because it's not the upstream code, sooner or later the actual code will be pulled from https://github.com/rust-lang/rust-clippy. In rust-lang/rust-clippy#7265 these changes I made here are included but for the future shouldn't changes to src/tools/clippy/clippy_lints/* in this repository be disallowed or shouldn't @rust-highfive give some kind of warning? It could potentially avoid confusion and good changes being lost.

@Mark-Simulacrum
Copy link
Member

That directory is synced both ways, changes to it are fine to make here.

@bors
Copy link
Contributor

bors commented Jun 4, 2021

☔ The latest upstream changes (presumably #85954) made this pull request unmergeable. Please resolve the merge conflicts.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 13, 2021
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jun 20, 2021

📌 Commit c08ea17 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2021
@bors
Copy link
Contributor

bors commented Jun 20, 2021

⌛ Testing commit c08ea17 with merge e82b650...

@bors
Copy link
Contributor

bors commented Jun 20, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing e82b650 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 20, 2021
@bors bors merged commit e82b650 into rust-lang:master Jun 20, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 20, 2021
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 1, 2021
Replace some `std::iter::repeat` with `str::repeat`

I noticed that there were some instances where `std::iter::repeat` would be used to repeat a string or a char to take a specific count of it and then collect it into a `String` when `str::repeat` is actually much faster and better for that.

See also: rust-lang/rust-clippy#7260.
@wooster0 wooster0 deleted the iterrepeat branch September 24, 2021 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants