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

Refactor convert file into the files related to the conversions #39

Closed
wants to merge 2 commits into from

Conversation

chipsenkbeil
Copy link
Owner

@chipsenkbeil chipsenkbeil commented Nov 30, 2024

Moves all of the convert.rs contents to specific files versus bundling conversion logic into a singular file that becomes a spaghetti of imports and logic.

  1. Conversions to/from WindowsComponent have been moved to the associated file.
  2. Conversions to/from UnixComponent have been moved to the associated file.

Stack created with Sapling. Best reviewed with ReviewStack.

Removes the implementation of `AsRef<std::path::Path>` for both `Utf8NativePath` and `Utf8NativePathBuf` to avoid situations where code using native path aliases appears to compile on one platform and fails on another.

```rust
// Compiles on Unix-like platforms, does not compile on Windows
fn foo(path: &UnixPath) -> _ {
    std::fs::exists(path)
}
```

It is instead recommended to use the new `PlatformPath` to ensure types are respected and work across operating system targets.
Moves all of the convert.rs contents to specific files versus bundling conversion logic into a singular file that becomes a spaghetti of imports and logic.

1. Conversions to/from `WindowsComponent` have been moved to the associated file.
2. Conversions to/from `UnixComponent` have been moved to the associated file.
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.

1 participant