-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking Issue for MAIN_SEPARATOR_STR #94071
Comments
What's the status on this? |
Probs still waiting on using |
@yaahc I gave your idea a go, but I don't think it makes sense: pub struct Separator;
impl Separator {
pub const STR: &str = crate::sys::path::MAIN_SEP_STR;
pub const CHAR: char = crate::sys::path::MAIN_SEP;
}
impl Deref for Separator {
type Target = str;
fn deref(&self) -> &Self::Target {
Self::STR
}
}
impl AsRef<str> for Separator {
fn as_ref(&self) -> &str {
self
}
}
impl AsRef<char> for Separator {
fn as_ref(&self) -> &char {
&Self::CHAR
}
} Hiding the str and char behind a type doesn't really help because the type isn't opaque. People are presumably coming to do low-level stuff with the &str or char so we can't get rid of those constants. Maybe if every API had been designed from the start to take in a On that note, how do I start an FCP? |
Stabilize `main_separator_str` See reasoning here: rust-lang#94071 (comment). Closes rust-lang#94071.
In topic: path separator named |
Stabilize `main_separator_str` See reasoning here: rust-lang/rust#94071 (comment). Closes #94071.
Feature gate:
#![feature(main_separator_str)]
This is a tracking issue for adding a static path separator str to match the static char already available.
Public API
Steps / History
Unresolved Questions
Can we combine the char and str API into one type that
AsRef
s to char, str, u8 etc. as needed?The text was updated successfully, but these errors were encountered: