Skip to content

Use interned symbols instead of strings in more places #14855

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samueltardieu
Copy link
Contributor

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented May 20, 2025

r? @y21

rustbot has assigned @y21.
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 May 20, 2025
@samueltardieu
Copy link
Contributor Author

Rebased

Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

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

Generally looks good, just one question

Comment on lines -13 to +18
complete_path: String,
parent: &[Symbol],
complete_path: impl FnOnce(&str) -> String,
) {
match attr_paths.entry(complete_path) {
let parent = parent.iter().join(":");
match attr_paths.entry(complete_path(&parent)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason for this closure-based change? The join + closure call (which invokes format!()) looks like it's doing essentially the same thing as before which had the format!() directly inlined as the function argument, or am I missing a subtle difference? (The change from Vec<String> to Vec<Symbol> is nice though)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, reading the other comment from Alexendoo, I guess the variable declaration line above used to be way longer and you wanted to share that between the two calls? It's not really much longer anymore now and the closure makes it slightly harder to tell what's going on but that's a bit pedantic, if you still think that's an improvement then I'm fine merging it as is too

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