-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsP-mediumMedium priorityMedium priority
Description
The only really cross-platform method to construct a path, is to construct one from components. For example os.path.join
is a well known way to do so in Python.
In Rust is not as obvious how to do that in a convenient manner. You could push
components one-by-one into a PathBuf
, but that sounds sort of inconvenient. There’s a
impl<P: AsRef<Path>> FromIterator<P> for PathBuf
implementation exactly for that, but it is extremely difficult to discover. Perhaps what we need is a in-your-face example on PathBuf
that explains the only really correct way to construct a multi-component PathBuf?
durka, estebank, makoConstruct, tmladek, zachs18 and 1 more
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsP-mediumMedium priorityMedium priority