From c6281d8ea0e7203d3ea2b1f22bad27562bbcb171 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:39:27 +1000 Subject: [PATCH] Fix `opts.no_cleanup` behavior Signed-off-by: Jiahao XU --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 62071031..d5d3c0d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -319,7 +319,10 @@ async fn entry() -> Result<()> { await_task(task).await?; } - if !opts.no_cleanup { + if opts.no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { temp_dir.close().unwrap_or_else(|err| { warn!("Failed to clean up some resources: {err}"); });