Skip to content

Expose more of std::path#22208

Merged
huonw merged 1 commit into
rust-lang:masterfrom
aturon:expose-more-path
Feb 18, 2015
Merged

Expose more of std::path#22208
huonw merged 1 commit into
rust-lang:masterfrom
aturon:expose-more-path

Conversation

@aturon

@aturon aturon commented Feb 12, 2015

Copy link
Copy Markdown
Contributor

This commit exposes the is_sep function and MAIN_SEP constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.

Exposing the prefix enum as part of prefix components involved changing
the type from OsStr to the Prefix enum, which is a:

[breaking-change]

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@aturon

aturon commented Feb 12, 2015

Copy link
Copy Markdown
Contributor Author

cc @blaenk

@blaenk

blaenk commented Feb 12, 2015

Copy link
Copy Markdown
Contributor

It looks good! Thank you very much.

Comment thread src/libstd/path.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it worth exposing both of these? Wouldn't is_sep be the same as foo == MAIN_SEP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, Windows supports both / and \ as separators.

@aturon aturon force-pushed the expose-more-path branch 2 times, most recently from 30ec019 to d855feb Compare February 12, 2015 06:38
@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+ d855febb1801dc2e9c5da80f30bf3d5bba8b5754

@huonw

huonw commented Feb 13, 2015

Copy link
Copy Markdown
Contributor

These seem used rarely enough that expanding sep to separator may be clearer?

@blaenk

blaenk commented Feb 13, 2015

Copy link
Copy Markdown
Contributor

Yeah, it was originally proposed as is_separator iirc, so if it's no trouble we might as well expand it, since it will essentially be set in stone after this. I won't die over it though.

@aturon

aturon commented Feb 13, 2015

Copy link
Copy Markdown
Contributor Author

Fixed!

@bors: r=nikomatsakis 949c37d

@aturon

aturon commented Feb 13, 2015

Copy link
Copy Markdown
Contributor Author

@bors: r=nikomatsakis a433c2f

@bors

bors commented Feb 13, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit a433c2f with merge cdb941e...

@bors

bors commented Feb 13, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-32-nopt-t

@aturon

aturon commented Feb 13, 2015

Copy link
Copy Markdown
Contributor Author

@bors: r=nikomatsakis 66e4c2f

@bors

bors commented Feb 14, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 66e4c2f with merge 44792ef...

@bors

bors commented Feb 14, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-32-nopt-t

@aturon

aturon commented Feb 15, 2015

Copy link
Copy Markdown
Contributor Author

@bors: r=nikomatsakis f2330ca

@blaenk

blaenk commented Feb 15, 2015

Copy link
Copy Markdown
Contributor

Any reason we're not exposing the Prefix methods? rust-lang/glob seems like it could use the is_verbatim. I could do the match manually, but if it's already there it seems like it'd be nice if it were exposed.

@bors

bors commented Feb 16, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit f2330ca with merge 2b151cb...

@bors

bors commented Feb 16, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-32-nopt-t

This commit exposes the `is_sep` function and `MAIN_SEP` constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.

Exposing the prefix enum as part of prefix components involved changing
the type from `OsStr` to the `Prefix` enum, which is a:

[breaking-change]
@aturon

aturon commented Feb 16, 2015

Copy link
Copy Markdown
Contributor Author

@bors: r=nikomatsakis 4a9dd3f

@bors

bors commented Feb 17, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 4a9dd3f with merge 4361aee...

@bors

bors commented Feb 17, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-32-nopt-t

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 17, 2015
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.

Exposing the prefix enum as part of prefix components involved changing
the type from `OsStr` to the `Prefix` enum, which is a:

[breaking-change]
@bors

bors commented Feb 18, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 4a9dd3f with merge 8d158c5...

@bors

bors commented Feb 18, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-mac-32-opt

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

@bors

bors commented Feb 18, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 4a9dd3f with merge 8c0b78e...

@huonw huonw merged commit 4a9dd3f into rust-lang:master Feb 18, 2015
@aturon aturon mentioned this pull request Feb 18, 2015
91 tasks
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.

7 participants