- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(normalize_lexically)]
This is a tracking issue for Path::normalize_lexically that is used to normalize a path, including .. parent references, without touching the filesystem.
Public API
// std::path
impl Path {
    pub fn normalize_lexically(&self) -> Result<PathBuf, NormalizeError> {
}Steps / History
- API Change Proposal
-  Implementation: Implement normalize_lexically#134696
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Should PathBufhave a method that normalizes in-place? Normalizing a path just removes components.
- Should this disallow resolving to the empty path or the single .path.
- Should this only allow paths without a root or prefix? It may be surprising that base_path.join(user_path.normalize_lexically()?)can still escape the base path.
The last two can be summarised as: should this strictly require paths to be sub-paths?
Footnotes
jieyouxu, folkertdev, liubocflt, Filiprogrammer, jonringer and 2 more
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.