Skip to content

Commit

Permalink
clarify why out_path is explicitly dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeidnx authored and viperML committed Aug 26, 2024
1 parent 3dc7cdc commit 6eb50ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ impl HomeRebuildArgs {
.build()?
.exec()?;

// Drop the out dir *only* when we are finished
// Make sure out_path is not accidentally dropped
// https://docs.rs/tempfile/3.12.0/tempfile/index.html#early-drop-pitfall
drop(out_path);

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion src/nixos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ impl OsRebuildArgs {
.exec()?;
}

// Drop the out dir *only* when we are finished
// Make sure out_path is not accidentally dropped
// https://docs.rs/tempfile/3.12.0/tempfile/index.html#early-drop-pitfall
drop(out_path);

Ok(())
Expand Down

0 comments on commit 6eb50ad

Please sign in to comment.