Skip to content

Make the output directory if it doesn't already exist.#65

Merged
theoxo merged 1 commit intomainfrom
mkdir
Mar 15, 2022
Merged

Make the output directory if it doesn't already exist.#65
theoxo merged 1 commit intomainfrom
mkdir

Conversation

@theoxo
Copy link
Copy Markdown
Collaborator

@theoxo theoxo commented Mar 15, 2022

Addresses #38.

println!("Wrote to {:?}",args.out);
let out_path = &args.out;
if let Some(out_path_dir) = out_path.parent() {
if !out_path_dir.exists() {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The double if is a bit ugly but it's necessary because "if"s and "if let"s are disjoint. Rust has implemented a fix to this (see here), but it's not in the stable branch yet.

@mlb2251
Copy link
Copy Markdown
Owner

mlb2251 commented Mar 15, 2022

LGTM

@theoxo theoxo merged commit 910b97d into main Mar 15, 2022
@theoxo theoxo mentioned this pull request Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants