Remove the redundant Dir struct #10
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Remove the
Dir
struct and move all directory resolution methods to module-level functions, simplifying the API fromDir::config_home()
toconfig_home()
.Type of Change
What Changed?
Dir
struct entirely - All static methods have been moved to module-level functionsDir::config_home()
toconfig_home()
pattern for all 19 directory functionsDir::
prefixed callsdocs/migration_guides/0.4.x-0.5.0.md
Why?
Dir::
prefix, making function calls more conciseuse dir_spec::{config_home, cache_home};
Dir::
prefix for every callHow Has This Been Tested?
mise test
)mise lint
)Additional verification:
cargo check
- Compilation verifiedcargo doc
- Documentation builds successfullyDir::
references remain in codebase (verified with grep)Screenshots/Demo
Before (v0.4.0):
After (v0.5.0):
Additional Notes
Dir::function_name(
withfunction_name(
The core functionality remains exactly the same - this is purely an API ergonomics improvement that makes the library more pleasant to use and more idiomatic Rust.