mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-08 09:05:34 +00:00
Use idiomatic TempDir::keep() instead of std::mem::forget()
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
parent
13e4ac033b
commit
b6b0952f41
1 changed files with 2 additions and 4 deletions
|
|
@ -305,10 +305,8 @@ impl TestEnvironment {
|
|||
/// Preserve the work directory by preventing TempDir cleanup
|
||||
/// Returns the path to the preserved directory
|
||||
pub fn preserve_work_dir(self) -> std::path::PathBuf {
|
||||
let work_dir = self.work_dir.clone();
|
||||
// Leak the TempDir to prevent cleanup
|
||||
std::mem::forget(self._temp_dir);
|
||||
work_dir
|
||||
// Use the idiomatic way to preserve a TempDir
|
||||
self._temp_dir.keep()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue