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

Avoid unnecessary heap allocation and copy #181

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Avoid unnecessary heap allocation and copy #181

merged 1 commit into from
Feb 24, 2024

Conversation

ryco117
Copy link
Contributor

@ryco117 ryco117 commented Feb 23, 2024

Looks like the current implementation of From<FileHandle> for PathBuf passes a Path reference to the PathBuf::from which results in a new heap allocation from a call to to_os_string() down the call-stack.

Since From<FileHandle> consumes the FileHandle it seems reasonable to consume the member PathBuf and return it to the caller without any copies or allocations.

@ryco117
Copy link
Contributor Author

ryco117 commented Feb 24, 2024

The error says that the changelog check can be avoided by adding the no changelog label. This seems reasonable since the change will not be visible.

@PolyMeilex PolyMeilex added the no changelog Ignore changelog CI check label Feb 24, 2024
@PolyMeilex PolyMeilex merged commit 73dcdf0 into PolyMeilex:master Feb 24, 2024
12 of 14 checks passed
@PolyMeilex
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Ignore changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants