Skip to content

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

Closed
wants to merge 6 commits into from

Conversation

milseman
Copy link
Contributor

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.

Copy link

@kylemacomber kylemacomber left a 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 {

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? {

Choose a reason for hiding this comment

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

Suggested change
private func _trailingSepIdx() -> Storage.Index? {
private func _trailingSeparatorIndex() -> Storage.Index? {

The abbreviation here seems ad hoc.

@milseman
Copy link
Contributor Author

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.

@milseman milseman closed this Dec 27, 2020
@milseman milseman deleted the clean_paths branch December 27, 2020 04:57
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