Description
In src/runner.rs, the handle_build function performs an unnecessary PathBuf clone when handling the emitted path (line 118):
Optimization Opportunity
The tuple type (PathBuf, Option<NamedTempFile>) could be replaced with (Cow<Path>, Option<NamedTempFile>) to avoid the allocation when borrowing the emitted path. The Some(path) branch would borrow the path without cloning, while the temp-file branch would own the path.
Context
This optimization was identified during the review of PR #82 and discussed in this comment thread.
Issue: #88
Requested by
@leynos
Description
In
src/runner.rs, thehandle_buildfunction performs an unnecessaryPathBufclone when handling the emitted path (line 118):Optimization Opportunity
The tuple type
(PathBuf, Option<NamedTempFile>)could be replaced with(Cow<Path>, Option<NamedTempFile>)to avoid the allocation when borrowing the emitted path. TheSome(path)branch would borrow the path without cloning, while the temp-file branch would own the path.Context
This optimization was identified during the review of PR #82 and discussed in this comment thread.
Issue: #88
Requested by
@leynos