-
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
base: master
Are you sure you want to change the base?
Conversation
|
@blyxyas what do you think? The approach seems to offer us optimal sizing (because we know the array length up front) and good perf. |
|
☔ The latest upstream changes (possibly e121ab8) made this pull request unmergeable. Please resolve the merge conflicts. |
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)
Alternative to part of #14509.
changelog: none