Skip to content

Commit f0de3cc

Browse files
committed
Improve std::path::Path::join documentation
Adapt `PathBuf::push` documentation for `Path::join` and add it to `join`'s docs
1 parent 840245e commit f0de3cc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

library/std/src/path.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,6 +2971,15 @@ impl Path {
29712971
/// Creates an owned [`PathBuf`] with `path` adjoined to `self`.
29722972
///
29732973
/// If `path` is absolute, it replaces the current path.
2974+
///
2975+
/// On Windows:
2976+
///
2977+
/// * if `path` has a root but no prefix (e.g., `\windows`), it
2978+
/// replaces and returns everything except for the prefix (if any) of `self`.
2979+
/// * if `path` has a prefix but no root, `self` is ignored and `path` is returned.
2980+
/// * if `self` has a verbatim prefix (e.g. `\\?\C:\windows`)
2981+
/// and `path` is not empty, the new path is normalized: all references
2982+
/// to `.` and `..` are removed.
29742983
///
29752984
/// See [`PathBuf::push`] for more details on what it means to adjoin a path.
29762985
///

0 commit comments

Comments
 (0)