Skip to content

Commit

Permalink
apple-codesign: avoid expect() when checking for parent directory
Browse files Browse the repository at this point in the history
This is cleaner.
  • Loading branch information
indygreg committed Nov 6, 2023
1 parent b893d4f commit c9e6850
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apple-codesign/src/bundle_signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,9 @@ impl<'a, 'key> BundleFileHandler for SingleBundleHandler<'a, 'key> {
let dest_path = self.dest_dir.join(dest_rel_path);

if source_path != dest_path {
std::fs::create_dir_all(
dest_path
.parent()
.expect("parent directory should be available"),
)?;
if let Some(parent) = dest_path.parent() {
std::fs::create_dir_all(parent)?;
}

let metadata = source_path.symlink_metadata()?;
let mtime = filetime::FileTime::from_last_modification_time(&metadata);
Expand Down

0 comments on commit c9e6850

Please sign in to comment.