Skip to content

Commit 272e743

Browse files
committed
nixos: simplify out_path lifetime management
1 parent 3950319 commit 272e743

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/nixos.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,8 @@ impl OsRebuildArgs {
181181
debug!("Target profile path: {}", target_profile.display());
182182
debug!("Target profile exists: {}", target_profile.exists());
183183

184-
// Take a strong reference to out_path to prevent premature dropping
185-
// This prevents the tempdir from being dropped early, which would cause nvd diff to fail
186-
#[allow(unused_variables)]
187-
let keep_alive = out_path.get_path().to_owned();
184+
// Note: out_path itself is kept alive until the end of this function,
185+
// which prevents the tempdir (if any) from being dropped early
188186

189187
if !target_profile
190188
.try_exists()

0 commit comments

Comments
 (0)