Feature gate: #![feature(const_path_initialization)]
This is a tracking issue for initializing &Path from a &str in a const context.
Public API
impl Path {
pub const fn from_os_str(s: &OsStr) -> &Path;
}
impl OsStr {
pub const fn from_str(s: &str) -> &OsStr;
}
Steps / History
Unresolved Questions
from_str conflicts with FromStr::from_str, what alternative name should we choose?
- Should we provide a direct
&str -> &Path conversion, instead of requiring to go through OsStr?
Feature gate:
#![feature(const_path_initialization)]This is a tracking issue for initializing
&Pathfrom a&strin a const context.Public API
Steps / History
Unresolved Questions
from_strconflicts withFromStr::from_str, what alternative name should we choose?&str -> &Pathconversion, instead of requiring to go throughOsStr?