Skip to content

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Jul 19, 2024

Clean up a few minor refs in format! macro, as it has a performance cost. Apparently the compiler is unable to inline format!("{}", &variable), and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental & misuse.

See rust-lang/rust-clippy#10851

Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 19, 2024
@Veykril
Copy link
Member

Veykril commented Jul 20, 2024

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jul 20, 2024

📌 Commit 3092e1c has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 20, 2024

⌛ Testing commit 3092e1c with merge 062822c...

@bors
Copy link
Contributor

bors commented Jul 20, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 062822c to master...

@bors bors merged commit 062822c into rust-lang:master Jul 20, 2024
@nyurik nyurik deleted the optimize-refs branch July 20, 2024 06:55
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.

4 participants