Skip to content

Commit 3b15b16

Browse files
committed
Explaining the reason why validation is performed in to_str of path.rs
1 parent 8a58268 commit 3b15b16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/path.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ impl Path {
18191819
/// Yields a [`&str`] slice if the `Path` is valid unicode.
18201820
///
18211821
/// This conversion may entail doing a check for UTF-8 validity.
1822+
/// Also it it worthwhile noting that validation is performed because Non-UTF-8 strings are
1823+
/// perfectly valid for some OS.
18221824
///
18231825
/// [`&str`]: ../primitive.str.html
18241826
///

0 commit comments

Comments
 (0)