Skip to content

Commit 282a3e7

Browse files
committed
refactor(core): Split out target-dir defaulting
1 parent 0d5370a commit 282a3e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ impl<'cfg> Workspace<'cfg> {
381381
pub fn target_dir(&self) -> Filesystem {
382382
self.target_dir
383383
.clone()
384-
.unwrap_or_else(|| Filesystem::new(self.root().join("target")))
384+
.unwrap_or_else(|| self.default_target_dir())
385+
}
386+
387+
fn default_target_dir(&self) -> Filesystem {
388+
Filesystem::new(self.root().join("target"))
385389
}
386390

387391
/// Returns the root `[replace]` section of this workspace.

0 commit comments

Comments
 (0)