1
0
Fork 0
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:
copilot-swe-agent[bot] 2025-09-27 19:00:23 +00:00
parent 13e4ac033b
commit b6b0952f41

View file

@ -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()
}
}