Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Config file creation may fail if its parent directory (app_config_dir) doesn't exist. #326

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

Xinyu-Li-123
Copy link
Contributor

As is described in the title.

…h. Simply using std::fs::File::create will fail in this case.
Copy link

✔️ Deskulpt Built Successfully!

Deskulpt binaries have been built successfully on all supported platforms. Your pull request is in excellent shape! You may check the built Deskulpt binaries here and download them to test locally.

Workflow file: .github/workflows/build.yaml. Generated for commit: 48138da.

Copy link
Contributor

@Charlie-XIAO Charlie-XIAO left a comment

Choose a reason for hiding this comment

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

LGTM, I've never thought that this directly may not exist.

Comment on lines +70 to +72
// On certain platform, if the file directory does not exist, file creation using std::fs:;File::create will fail.
// See [the doc](https://doc.rust-lang.org/std/fs/struct.File.html#method.create) for detail.
// Thus we need to manually create app_config_dir if it doesn't exist.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// On certain platform, if the file directory does not exist, file creation using std::fs:;File::create will fail.
// See [the doc](https://doc.rust-lang.org/std/fs/struct.File.html#method.create) for detail.
// Thus we need to manually create app_config_dir if it doesn't exist.
// On certain platform, if the file directory does not exist, file creation using
// std::fs::File::create will fail. Thus we need to manually create app_config_dir
// if it doesn't exist.

rustfmt seems not to warn against excessively long comment lines (at least not with the current configuration 🤔) but let's still obey the 88-column rule.

@Xinyu-Li-123 Xinyu-Li-123 merged commit 82a400c into main Dec 12, 2024
11 checks passed
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