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

Optimize Build::get_out_dir: Return Cow<'_, Path> #831

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Optimize Build::get_out_dir: Return Cow<'_, Path> #831

merged 1 commit into from
Jul 21, 2023

Conversation

NobodyXu
Copy link
Collaborator

@NobodyXu NobodyXu commented Jul 21, 2023

to avoid heap allocation if possible.

to avoid heap allocation if possible.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu
Copy link
Collaborator Author

Build::get_{target, host, opt_level, debug} also returns Cow<str>, so it does make sense to also change Build::get_out_dir to return Cow<'_, Path>

@NobodyXu

This comment was marked as outdated.

@NobodyXu NobodyXu closed this Jul 21, 2023
@NobodyXu NobodyXu deleted the optimize-get_out_dir branch July 21, 2023 03:51
@NobodyXu NobodyXu restored the optimize-get_out_dir branch July 21, 2023 03:55
@NobodyXu NobodyXu reopened this Jul 21, 2023
@NobodyXu

This comment was marked as outdated.

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

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

Seems fine.

@thomcc thomcc merged commit f74fe61 into rust-lang:main Jul 21, 2023
32 checks passed
@NobodyXu NobodyXu deleted the optimize-get_out_dir branch July 21, 2023 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants