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

Start removing snippet_opt in favor of get_source_text #13244

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Aug 9, 2024

Continuing the job of removing unnecessary allocations.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 9, 2024
@xFrednet xFrednet added the performance-project For issues and PRs related to the Clippy Performance Project label Aug 9, 2024
bors added a commit that referenced this pull request Aug 12, 2024
Remove more `snippet_opt` calls

First commit is the same as #13244

changelog: none
Comment on lines 183 to 184
let from = from.as_str();
let into = into.as_str();
Copy link
Member

Choose a reason for hiding this comment

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

These look like they'd be unneeded

@@ -83,7 +84,7 @@ impl<'tcx> LateLintPass<'tcx> for BorrowDerefRef {
diag.span_suggestion(
e.span,
"if you would like to reborrow, try removing `&*`",
snippet_opt(cx, deref_target.span).unwrap(),
deref_text.as_str(),
Copy link
Member

Choose a reason for hiding this comment

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

Can we impl the Into<DiagnosticThingy> to pass this as is? I think this will come up a bunch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

span_suggestion only requires ToString. deref_text is used right afterwards so it doesn't help here.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh yeah, was thinking of the wrong arg 🤦‍♂️

@Alexendoo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 21, 2024

📌 Commit 8a4c34a has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 21, 2024

⌛ Testing commit 8a4c34a with merge ecfc7d9...

@bors
Copy link
Contributor

bors commented Aug 21, 2024

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

@bors bors merged commit ecfc7d9 into rust-lang:master Aug 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance-project For issues and PRs related to the Clippy Performance Project 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.

5 participants