Skip to content

Commit 5dc070e

Browse files
authored
Revise Path type documentation for clarity
Updated the description of the `Path` type to clarify its usage across platforms and simplified the language. I updated src/std_misc/path.md to remove references to separate posix::Path/windows::Path and reflect that there’s a single std::path::Path. I also simplified the closing guidance to point users to Path methods and Metadata.
1 parent 160e6bb commit 5dc070e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/std_misc/path.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Path
22

3-
The `Path` struct represents file paths in the underlying filesystem. There are
4-
two flavors of `Path`: `posix::Path`, for UNIX-like systems, and
5-
`windows::Path`, for Windows. The prelude exports the appropriate
6-
platform-specific `Path` variant.
3+
The `Path` type represents file paths in the underlying filesystem. Across all
4+
platforms there is a single `std::path::Path` that abstracts over
5+
platform-specific path semantics and separators. Bring it into scope with
6+
`use std::path::Path;` when needed.
77

88
A `Path` can be created from an `OsStr`, and provides several methods to get
99
information from the file/directory the path points to.
@@ -47,8 +47,7 @@ fn main() {
4747
}
4848
```
4949

50-
Be sure to check at other `Path` methods (`posix::Path` or `windows::Path`) and
51-
the `Metadata` struct.
50+
Be sure to check other `Path` methods and the `Metadata` struct.
5251

5352
### See also:
5453

0 commit comments

Comments
 (0)