PolyMeilex / rfd

Rusty File Dialog
MIT License
524 stars 60 forks source link

Avoid unnecessary heap allocation and copy #181

Closed ryco117 closed 4 months ago

ryco117 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

Thanks!