-
Notifications
You must be signed in to change notification settings - Fork 114
Code cleanup; FilePath separator normalization #15
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I recall seeing some unit tests that looked like they exercised the separator normalization logic. Are those already on main? If not, should we pull them in as part of this patch?
// The platform preferred separator | ||
// | ||
// TODO: Make private | ||
private var platformSeparator: SystemChar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is private I think you can remove the TODO.
extension FilePath { | ||
// For invariant enforcing/checking. Should always return `nil` on | ||
// a fully-formed path | ||
private func _trailingSepIdx() -> Storage.Index? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private func _trailingSepIdx() -> Storage.Index? { | |
private func _trailingSeparatorIndex() -> Storage.Index? { |
The abbreviation here seems ad hoc.
Co-authored-by: Kyle Macomber <[email protected]>
Co-authored-by: Kyle Macomber <[email protected]>
Co-authored-by: Kyle Macomber <[email protected]>
Closing this, FIlePath syntactic operations has diverged significantly. I could consider doing some of the refactoring in a separate PR, though it might make more sense to just do it as a rebasing on that PR. |
Splitting off some of the work being done in #14. This brings in the separator normalizing behavior as well as re-arranging some of the source code.