From 778809b71e00f0286e65733b236cab6a53b198ff Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Thu, 4 Jul 2024 07:24:27 +0900 Subject: [PATCH] fix the unit test failure --- src/extractor.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extractor.rs b/src/extractor.rs index 20ff959..de287c2 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -33,10 +33,11 @@ impl ExtractorOpts { /// The target is the archive file name of source. pub fn destination(&self, target: &PathBuf) -> Result { let dest = self.destination_file(target); - if dest.exists() && self.overwrite { - Ok(dest) - } else { + println!("destination: {:?}", dest); + if dest.exists() && !self.overwrite { Err(ToteError::FileExists(dest.clone())) + } else { + Ok(dest) } }