Skip to content

Commit

Permalink
Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Mar 2, 2025
1 parent e192275 commit 6e5640b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ impl Wallet {
bail!("wallet `{}` at `{}` already exists", name, path.display());
}

if let Err(err) = fs::create_dir_all(path.parent().unwrap()) {
bail!(
"failed to create data dir `{}`: {err}",
path.parent().unwrap().display()
);
let dir = path.parent().unwrap();
if let Err(err) = fs::create_dir_all(dir) {
bail!("failed to create data dir `{}`: {err}", dir.display());
}

let database = Database::builder().create(&path)?;
Expand Down

0 comments on commit 6e5640b

Please sign in to comment.