From 8f7c43c2275f93d5b90aaea1357b7d48c1aba391 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 23:46:09 +1000 Subject: [PATCH] Rm unnecessary `p.exist()` check in `ZipStreamReader::extract` Signed-off-by: Jiahao XU --- src/read/stream.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/read/stream.rs b/src/read/stream.rs index bb8e5ee5..a8ae65d5 100644 --- a/src/read/stream.rs +++ b/src/read/stream.rs @@ -71,9 +71,7 @@ impl ZipStreamReader { fs::create_dir_all(&outpath)?; } else { if let Some(p) = outpath.parent() { - if !p.exists() { - fs::create_dir_all(&p)?; - } + fs::create_dir_all(&p)?; } let mut outfile = fs::File::create(&outpath)?; io::copy(file, &mut outfile)?;