Skip to content

Commit

Permalink
rust: Use Path::exists
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Aug 21, 2024
1 parent c6784d9 commit 5be3f18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/dekoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5be3f18

Please sign in to comment.