Skip to content

Prevent unnecessary allocation in PathBuf::set_extension. - #65731

Merged
bors merged 1 commit into
rust-lang:masterfrom
fusion-engineering-forks:set-extension
Oct 25, 2019
Merged

Prevent unnecessary allocation in PathBuf::set_extension.#65731
bors merged 1 commit into
rust-lang:masterfrom
fusion-engineering-forks:set-extension

Conversation

@m-ou-se

Copy link
Copy Markdown
Member

It was allocating a new OsString that was immediately dropped after using it with set_file_name. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2019
It was allocating a new OsString that was immediately dropped after
using it with set_file_name. Now it directly changes the extension in
the original buffer, without touching the rest of the file name or
allocating a temporary string.

@dtolnaydtolnay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Nicely done.

@dtolnay

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Oct 25, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 18ae175 has been approved by dtolnay

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 25, 2019
…ion, r=dtolnay
Prevent unnecessary allocation in PathBuf::set_extension.
It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.
@CentrilCentril mentioned this pull request Oct 25, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 25, 2019
…ion, r=dtolnay
Prevent unnecessary allocation in PathBuf::set_extension.
It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.
@CentrilCentril mentioned this pull request Oct 25, 2019
bors added a commit that referenced this pull request Oct 25, 2019
Rollup of 9 pull requests
Successful merges:
- #64639 (Stabilize `#[non_exhaustive]` (RFC 2008))
- #65074 (Fix the start/end byte positions in the compiler JSON output)
- #65315 (Intern place projection)
- #65685 (Fix check of `statx` and handle EPERM)
- #65731 (Prevent unnecessary allocation in PathBuf::set_extension.)
- #65740 (Fix default "disable-shortcuts" feature value)
- #65787 (move panictry! to where it is used.)
- #65789 (move Attribute::with_desugared_doc to librustdoc)
- #65790 (move report_invalid_macro_expansion_item to item.rs)
Failed merges:
r? @ghost
@bors
bors merged commit 18ae175 into rust-lang:masterOct 25, 2019
@m-ou-se
m-ou-se deleted the set-extension branch October 25, 2019 14:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@m-ou-se@rust-highfive@dtolnay@bors