-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use extend when creating the lint pass constructors
#15994
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
Conversation
5b13034 to
f5e4a01
Compare
|
@blyxyas what do you think? The approach seems to offer us optimal sizing (because we know the array length up front) and good perf. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I haven't benchmarked it, but I've never heard of a conversion from Vec to [T; N] that caused a performance regression.
| format!("Box::new(move |{ctor_arg}| Box::new({module_name}::{camel_name}::new(conf))),\n ",) | ||
| } else { | ||
| format!("store.register_{lint_pass}_pass(|{ctor_arg}| Box::new({module_name}::{camel_name}));\n ",) | ||
| format!("Box::new(|{ctor_arg}| Box::new({module_name}::{camel_name})),\n ",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why those spaces are there? (After \n)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's to start the next line with the right amount of indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's so the marker comment stays indented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, +1 to the merge after the conflicts are resolved
|
r=me after a rebase |
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Alternative to part of #14509.
changelog: none