diff --git a/crates/dekoder/src/lib.rs b/crates/dekoder/src/lib.rs index 889f1d464..5de6be7cb 100644 --- a/crates/dekoder/src/lib.rs +++ b/crates/dekoder/src/lib.rs @@ -98,10 +98,10 @@ const TAR_WRITER_CAPACITY: usize = 128 * 1024; impl EKO { /// Check our working directory is safe. fn assert_working_dir(&self) -> Result<()> { - if !self.path.try_exists().is_ok_and(|x| x) { - return Err(EKOError::NoWorkingDir); - } - Ok(()) + self.path + .exists() + .then_some(()) + .ok_or(EKOError::NoWorkingDir) } /// Remove the working directory.