-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
expost Path::sep{,_byte} #11642
expost Path::sep{,_byte} #11642
Conversation
lgtm. Thanks. |
@@ -117,6 +117,20 @@ pub use StrComponentIter = self::windows::StrComponentIter; | |||
#[cfg(windows)] | |||
pub use RevStrComponentIter = self::windows::RevStrComponentIter; | |||
|
|||
/// Typedef for the platform-native separator character. | |||
#[cfg(unix)] | |||
pub use sep = self::posix::sep; |
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.
Stylistically, shouldn't these be SEP
and SEP_BYTE
?
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.
Hrm, possibly. We've been exposing std::path::posix::sep
and std::path::windows::sep
already. I have no objection to capitalizing them though.
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.
@huonw: good point, capitalizing them now.
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.
(Also, it's not a "typedef" so much as an alias.)
r=me after fixing the doc comment nit. |
This pull request exposes a platform independent way to get the path separator. This is useful when building complicated paths by hand.
improve [`cast_sign_loss`], to skip warning on always positive expressions fixes: rust-lang#11642 changelog: improve [`cast_sign_loss`] to skip warning on always positive expressions Turns out this is change became quite big, and I still can't cover all the cases, like method calls such as `POSITIVE_NUM.mul(POSITIVE_NUM)`, or `NEGATIVE_NUM.div(NEGATIVE_NUM)`... but well, if I do, I'm scared that this will goes forever, so I stopped, unless it needs to be done, lol.
This pull request exposes a platform independent way to get the path separator. This is useful when building complicated paths by hand.