-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
path: Move is_absolute check to sys::path #135405
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
Conversation
e3fe894 to
658e26b
Compare
|
This winds up keeping roughly the same pattern but has it repeated it in a few places, I'm not sure how strong the benefit is here. The UEFI implementation does look more complex though - would it work to leave the existing code but do something like this? #[cfg(not(target_os = "uefi")]
return sys::path::is_absolute(self);
if cfg!(target_os = "redox") { /* rest of the existing code */ } |
Well, the UEFI absolute check is pretty simple as well: With that said, I thought it was the policy not to introduce any new platform-specific behaviour outside of |
I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1]. This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not. I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases. [0]: rust-lang#135368 [1]: rust-lang#52331 (comment) Signed-off-by: Ayush Singh <ayush@beagleboard.org>
658e26b to
1107382
Compare
Ah thanks, I was looking at the wrong code.
I wouldn't think there could be much wrong with adding another branch to the existing config, especially considering that exact |
|
@bors r+ rollup |
I am working on fs support for UEFI 0, which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended 1.
This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not.
I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases.