Skip to content

Commit d697b4d

Browse files
committed
Improve std::path::Path::join documentation
Adapt `PathBuf::push` documentation for `Path::join` and add it to `join`'s docs Fix to comply with tidy Remove unnecessary whitespace
1 parent 840245e commit d697b4d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎library/std/src/path.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,6 +2972,15 @@ impl Path {
29722972
///
29732973
/// If `path` is absolute, it replaces the current path.
29742974
///
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.
2983+
///
29752984
/// See [`PathBuf::push`] for more details on what it means to adjoin a path.
29762985
///
29772986
/// # Examples

0 commit comments

Comments
 (0)